In the example below, return false
does not seem to prevent the default action after the link is clicked (because the page scrolls to the top) in Firefox 3.6 or
You say "preventDefault()
helps" but you say it doesn't work? I'm not sure I understand. Have you tried this:
addEventListener("DOMContentLoaded", function() {
document.getElementById("link").addEventListener("click", function(e) {
alert("Clicked!");
e.preventDefault();
return false;
}, false);
alert("Click handler bound!");
}, false);