Saturday, 24 August 2013

Previous Interview Question Next Interview Question
Home

What is the difference between event.PreventDefault and event.stopPropagation?

event.preventDefault(): Stops the default action of an element from happening. 
event.stopPropagation(): Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event. For example, if there is a link with a click method attached inside of a DIV or FORM that also has a click method attached, it will prevent the DIV or FORM click method from firing.

Previous Interview Question Next Interview Question
Home

0 comments :

Post a Comment