Make rel external links opens in a new window with jQuery, displaying it in the link title

/ Published in: jQuery
Save to your folder(s)

Copy this code and paste it in your HTML
  1. $("a[rel*='external']").each(function(){
  2. $(this).attr({
  3. target:"_blank",
  4. title: ($(this).attr("title")) ? "New window: " + $(this).attr("title") : "Open in new window"
  5. });
  6. });

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.