$(document).ready(function() {
$("a[href^='http']").not("[href*='mysite.com']").attr('target','_blank');
});
... and to match two urls/domains/whatever:
$(document).ready(function() {
$("a[href^='http']").not("[href*='mysite.com'],[href*='mysite2.com']").attr('target','_blank');
});
Add new comment