我试图替换href按钮中的一个简单url,以及一些如何将一切搞砸的东西。
<button onclick="location.href="https://arborapaloalto.securecafe.com/onlineleasing/arbora/scheduletour.aspx">Request an appointment</button>
我做错了什么?
您在onclick
中使用了双引号。对于href URL,您需要切换到单引号:
<button onclick="location.href='https://arborapaloalto.securecafe.com/onlineleasing/arbora/scheduletour.aspx'">Request an appointment</button>
在新选项卡中打开:
<button onclick="window.open('https://arborapaloalto.securecafe.com/onlineleasing/arbora/scheduletour.aspx', '_blank')">Request an appointment</button>