Open all external links in new tab
$("a[href^='http://'], a[href^='https://'], a[href^='//']").attr("target","_blank");
Library of HTML, CSS, PHP, SQL, JavaScript & jQuery Code Snippets
$("a[href^='http://'], a[href^='https://'], a[href^='//']").attr("target","_blank");