Open All External Links in a New Window/Tab using jQuery
1 2 3 |
$(document).ready(function() { $("a[href^='http']").not("[href*='mysite.com']").attr('target','_blank'); }); |
1 2 3 |
$(document).ready(function() { $("a[href^='http']").not("[href*='mysite.com'],[href*='mysite2.com']").attr('target','_blank'); }); |