// This will look for all links with rel="external" // and cause the link to open in a new window. $(document).ready( function() { $('A[rel="external"]').click( function() { window.open( $(this).attr('href') ); return false; }); });