Jul 9, 2015 – yannickoo You need it everytime when your client needs it. $('a[href]').each(function() { var a = new RegExp('/' + window.location.host + '/'); if (!a.test(this.href)) { $(this).click(function(e) { e.preventDefault(); e.stopPropagation(); window.open(this.href, '_blank'); }); } });