xxxxxxxxxx
// Assuming you have a link element with the id "myLink"
var link = document.getElementById("myLink");
link.target = "_blank";
xxxxxxxxxx
//open in new window, not new tab
window.open('https://www.codegrepper.com', '_blank', 'toolbar=0,location=0,menubar=0');
xxxxxxxxxx
// javascript open new tab window
function NewTab() {
window.open(
"https://www.yourURL.com", "_blank");
}
//----------------------
window.open(url,'_blank');
//----------------------
//--open in new window, not new tab
window.open('https://www.codegrepper.com', '_blank', 'toolbar=0,location=0,menubar=0');