How can I open multiple links using a single anchor tag

北城余情 提交于 2019-11-26 12:25:21

问题


So here\'s a simple but interesting question, how can I open multiple links using single <a> element?

Using this only opens the first href

<a href=\"http://www.google.com\" href=\"http://www.yahoo.com\" target=\"_blank\">Click Here</a>

回答1:


You can certainly try this

Demo

<a href="http://www.microsoft.com" target="_blank" onclick="window.open('http://www.google.com'); window.open('http://www.yahoo.com');">Click Here</a>


来源:https://stackoverflow.com/questions/13965753/how-can-i-open-multiple-links-using-a-single-anchor-tag

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