/ Published in: jQuery
Expand |
Embed | Plain Text
/** * Convert the links with rel="external" * * v. 0.1 Updated (07/02/11) * - Changed de CSS selector adding the posibility to external wasn't the only string in rel * attribute. * - Changed de string from "extern" to "external", that's looks more adequate. * */ function initRelLinks(){ jQuery('a[rel*="external"]').click(function(){ jQuery(this).attr('target', '_blank'); }); }
Comments
Subscribe to comments
You need to login to post a comment.

Or you can use this:
jQuery('a[rel="extern"]').each(function() { jQuery(this).attr('target', '_blank'); });
Of course AllKnightAccess, thats another solution ;)