If you spacebar on a checkbox, it checks the box. Everything was fine until I decide to disable the click event on the parent div, which I realized, disabled the spacebar on the checkbox as well!
div1.addEventListener("click",function (e) {
if (e.preventDefault) e.preventDefault();
e.cancelBubble = true;
return false;
}, true);
<div id="div1">
<input id="chk1" type="checkbox">
</div>
http://jsfiddle.net/0t01252x/1/
How can I prevent that? It seems like a very odd behaviour to me. Click events are click events, not keyboard events...
Note: tested with chrome and FF
Edit: worst: outputing the event in the console gives a ... MouseEvent!