Skip to content

Instantly share code, notes, and snippets.

@bastianallgeier
Created April 30, 2012 09:40
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bastianallgeier/2556891 to your computer and use it in GitHub Desktop.
Save bastianallgeier/2556891 to your computer and use it in GitHub Desktop.
Do your clients have the incurable target=_blank disease for external links? Add this jQuery snippet to your js code to add targets to all external links.
$(function() {
$('a').not('[href*=clientdomain\\.com]').attr('target', '_blank');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment