Skip to content

Instantly share code, notes, and snippets.

@ddeveloperr
Created March 25, 2015 13:34
Show Gist options
  • Save ddeveloperr/10e71bf1345073558ddb to your computer and use it in GitHub Desktop.
Save ddeveloperr/10e71bf1345073558ddb to your computer and use it in GitHub Desktop.
open-links in-blank using .js
function addBlankTargetForLinks () {
$('a[href^="http"]').each(function(){
$(this).attr('target', '_blank');
});
}
$(document).bind('DOMNodeInserted', function(event) {
addBlankTargetForLinks();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment