How can I open multiple links using a single ancho

2019-01-06 14:06发布

问题:

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>


标签: html anchor