+ 6
How can open new tab in browser by using javascript?
help me to open new tab in browser by using JavaScript. eg-:- we can do it by target="_blank" in html but how in JavaScript.
2 Answers
+ 4
window.open("http://my_site.net/url","_blank");
https://developer.mozilla.org/en/docs/Web/API/Window/open
+ 1
document.getElementById("link").setAttribute("target", "_blank");