Dev
Dev

Reputation: 3

How to use target blank to open urls in different tabs

I am trying to open some url in new tabs, I want that every time I click on some button it will open up a new tab different tab. I am using window.open for this and this is opening my url in one single new tab..

My code is

window.open("myurl.com", "target=_blank"); "return false;";

Please help

Upvotes: 0

Views: 142

Answers (2)

David Antoon
David Antoon

Reputation: 825

Another ugly way using jQuery:

$('<a href="myurl.com" target="_blank"></a>')[0].click()

Upvotes: 0

aavrug
aavrug

Reputation: 1889

window.open("myurl.com", "_blank");

Upvotes: 4

Related Questions