Answers for "Detect external link Click javascript"

0

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);
}
Posted by: Guest on May-22-2021

Code answers related to "Detect external link Click javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language