5 ms·
When using addEventListener, "this" is not necessarily bound to the DOM node. You can also pass an Object whith a "handleEvent" function as attribute, instead o
by b3tta 14y ago
When using addEventListener, "this" is not necessarily bound to the DOM node. You can also pass an Object whith a "handleEvent" function as attribute, instead of directly passing a function.
You can read more about it for instance here: http://www.thecssninja.com/javascript/handleevent http://www.thecssninja.com/javascript/handleevent