3 ms·
Javascript event registration models, good explanation
- jarek-foksa 15y agoIt's worth noting that DOM4 spec makes third argument in addEventListener() method optional. It will default to false if you skip it (which is almost always preferable): element.addEventListener('mousedown', callback);
- dmethvin 15y agoThere's also an object-based argument to addEventListener: http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventListener http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-E... More discussion here: http://ajaxian.com/archives/an-alternative-way-to-addeventlistener http://ajaxian.com/archives/an-alternative-way-to-addeventli...