/ Published in: JavaScript
                    
                                        
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
function doStandardsCompliantExternalLinks() {
if (!document.getElementsByTagName) {return;}
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
if (anchors[i].getAttribute("href") && anchors[i].getAttribute("rel") == "external") {// for example: title="Download Adobe Reader" rel="external"
anchors[i].target = "_blank";
anchors[i].title += " - Opens in new window";
}
}
}
Comments
 Subscribe to comments
                    Subscribe to comments
                
                