Return to Snippet

Revision: 12848
at March 30, 2009 18:35 by elemint


Initial Code
function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;

Initial URL
http://www.sitepoint.com/article/standards-compliant-world/

Initial Description
<script></script>

Initial Title
Open Link in New Window

Initial Tags

                                

Initial Language
JavaScript