Skip to content

Instantly share code, notes, and snippets.

@bastianallgeier
bastianallgeier / external.js
Last active March 23, 2016 14:04
For those "external links should open in new tabs" clients…
$('a').each(function() {
if(this.host !== window.location.host) {
$(this).attr('target', '_blank');
}
});