[thelist] Tip: Quicker and less memory extensive web apps with Event Delegation

Christian Heilmann codepo8 at gmail.com
Mon Sep 25 02:01:29 CDT 2006


<tip author="Chris Heilmann" type="JavaScript Events">
In order to cut down on the amount of event handling in applications
you can simply assign one event handler on a parent element and
retrieve the element that was activated via a getTarget() method. This
is possible because elements report event activity to their parent
nodes (event bubbling). This trick is called event delegation:
http://icant.co.uk/sandbox/eventdelegation/
</tip>

-- 
Chris Heilmann
Book: http://www.beginningjavascript.com
Blog: http://www.wait-till-i.com
Writing: http://icant.co.uk/



More information about the thelist mailing list