document.getElementById("mahacareer").onclick = function () {
window.open("http://www.mahacareermitra.in", '_blank');
};
<a href="" id="mahacareer">Access the portal</a>
Hi there, I am looking to have the link above open in a new tab when clicked. Typically, we use the target="_blank" attribute with the anchor tag, but I want to achieve the same result using JavaScript.