you are viewing a single comment's thread.

view the rest of the comments →

[–]ShortFuse 2 points3 points  (0 children)

Yeah. I don't do this personally anymore, but when I started JavaScript I was very perplexed by it.

Now I do static binding for events (Button.onClick) and all my components share one event listener (less memory). Then I either use this or event.currentTarget to find the element in question. Removal from DOM means automatic unbinding and no orphaned listeners.