Opening a link in a new tab
Is there specific syntax that would allow me to force viewer to open a particular link in a new tab as opposed the the currently open one?
Thanks
Mike
Is there specific syntax that would allow me to force viewer to open a particular link in a new tab as opposed the the currently open one?
Thanks
Mike
Wether this opens in a new tab or new window will be dependent on the users browser settings, but this should do what you want it to.
<a class="link">Link</a>
<script type="text/javascript">
$("a.link").on("click",function(){
window.open('www.yourdomain.com','_blank');
});
</script>
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.