html button按钮模拟超链接的三种方法.

 

方法一:form表单方法

实现代码:

<form method=\"get\" action=\"http://www.manongjc.com\">
    <button type=\"submit\">Continue</button>
</form>

 

方法二:window.location.href 方法

代码如下:

<button  =\"window.location.href=\'http://www.manongjc.com\'\">Continue</button>

 

方法三:在button之外添加超链接

<a href=\"http://www.manongjc.com\" target=\"_blank\">
<button>My Button</button>
</a>
收藏 打印