I followed this post and it works fine:
How can i make a link do some jquery then go to destination
How can i add the equivalent to target=”_blank”?
I want the destination page to open in a new tab
I followed this post and it works fine:
How can i make a link do some jquery then go to destination
How can i add the equivalent to target=”_blank”?
I want the destination page to open in a new tab
You can use window.open
as following
$('#link').click(function(e){
e.preventDefault();
alert('you clicked');
window.open($(this).attr('href'),'_blank');
});
The first parameter will get url from anchor tag href
attribute and then second will add target _blank
property.