Hacker News new | ask | show | jobs
by b3tta 4912 days 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