Created
February 13, 2017 16:44
-
-
Save Shwartz/c491a83689f2e225e7cd6d7fd8be8fa4 to your computer and use it in GitHub Desktop.
For testing clickable elements add preventDefault() to all of them
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener("load", function () { | |
console.warn('------------------- EAGLE LANDED -------------------') | |
let arr = Array.from(document.getElementsByTagName('a')); | |
console.warn('A TAGS', arr.length); | |
arr.forEach(function (a) { | |
a.addEventListener('click', function (e) { | |
console.warn('CLICK ELEM', e.target); | |
e.preventDefault(); | |
}); | |
}); | |
}, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment