Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Detect external link Click javascript

var externalLinks = document.querySelectorAll('a[href^="http"]');
for (var i = externalLinks.length-1; i >= 0; i--) {
    externalLinks[i].addEventListener("click", function() { alert(); }, false);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Detect #external #link #Click #javascript
ADD COMMENT
Topic
Name
3+5 =