Home > bubbling in javascript

event.preventDefault() vs event.stopPropagation() vs return false

This article provides the information how can we prevent default behavior/action of an element in jQuery. Sometimes we need to stop/prevent element default action when a certain event is fired using jQuery.Event object methods we can achieve that event. We will see all three methods with a DEMO  event.preventDefault() event.preventDefault();  method is stop default

This Article is TAGGED in , , , , . Read more

Event bubbling and capturing in Javascript

Event bubbling and event capturing are two ways of event propagation in DOM structure.Ex. There are two HTML elements embedded in one another as:Event bubbling: the event is captured in span element first and then in div.Event Capturing: the event is captured in div element first and then in span.Browser Support: In older

This Article is TAGGED in , . Read more