+ 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.

15th Jan 2018, 4:27 AM
Bibek Oli
Bibek Oli - avatar
2 odpowiedzi
15th Jan 2018, 7:45 AM
visph
visph - avatar
+ 1
document.getElementById("link").setAttribute("target", "_blank");
15th Jan 2018, 4:41 AM
John Wells
John Wells - avatar