Opening an external website in a new tab/window/popup

巧了我就是萌 提交于 2019-12-07 15:58:36

You cannot do that with pure HTML - to achieve the result you need JavaScript.

<a href="http://www.example.com" onclick="window.open('http://www.example.com', 
                                         'newwindow', 
                                         'width=700,height=500'); 
              return false;">Click here</a>

However, this solution is vulnerable to be pop-up blocked.

As @Rob M. suggested, here you can read everything about window.open().

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!