A JavaScript Curiosity Regarding addEventListener
I’m wondering why this code fails to stop a form submission document.forms[0].addEventListener(“submit”,falsify, false); function falsify() { return false; } and this code successfully kills it? document.forms[1].onsubmit = falsify; function falsify() { return false; } Try it out (Firefox/Safari/Chrome/Opera only- there’s no addEventListener support in Internet Explorer). The form action on both is an alert. The […]