I have multiple anchor tag in a page. I want to click all the tag from jQuery to open each link in a new tab. But it is working only for the first element.
My attempt is below:
$('.tbl a').each(function () {
var url = $(this).attr("href");
window.open(url, '_blank');
})
Note: if I set background color in each it works well. Then why not new Tab?
2
Answers
My suggestion from the comments would look something like this :
Won’t work here, because the sandoxed frame does not allow popups, but you get the idea.
Building on the answer in the comments,