Blueherb In solitude, where we are least alone

HTML中使用<input>添加的按钮打开一个链接

   在HTML中,<form>表单的<input type="button">可以添加一个按钮。如果想让该按钮实现<a> 的超链接功能,需要如下实现:

    在新的窗口中打开页面(target = blank):<input type="button" onclick="window.open('new.jsp')">

    在当前窗口中打开页面(target = self)  :  <input type="button" onclick="window.location.href='new.jsp'">

 注意:第2个不要用onclick="window.location.href('new.jsp')" ,这种方式有些浏览器,如360安全浏览器等,不能够识别。

posted @ 2014-08-19 08:56  Blueherb  阅读(1133)  评论(0编辑  收藏  举报