1 2 3 4 5 6 7 |
//Open external links in a new tab jQuery('a').not('[href*="mailto:"]').each(function () { var isInternalLink = new RegExp('/' + window.location.host + '/'); if (!isInternalLink.test(this.href)) { jQuery(this).attr('target', '_blank'); } }); |