December 2013
Intermediate to advanced
384 pages
9h 54m
English
function myEventHandler(e){ ...handler code... e.stopPropogation(); return false; }
Often, you don’t want an event to bubble up to parent objects because you have already handled it in a child object. JavaScript provides a simple way to stop bubbling from occurring. Calling the event.stopPropagation() method on the event object passed to the handler stops the event from bubbling up to parent elements. The event still triggers the default handlers in the browser that provide the web page interaction, such as selecting a check box or activating a link.
Read now
Unlock full access