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



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

Answer / chaitanya

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.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More jQuery Interview Questions

How is the deferred method in jquery important in relation to animate method?

0 Answers  


What is the use jQuery.data method?

0 Answers  


What happen if you return false from a jQuery event handler?

0 Answers  


How can you get the type of arguments passed to a function?

0 Answers  


Which are the fastest selectors in jquery? : jquery mobile

0 Answers  






Which sign is used as a shortcut for jQuery?

0 Answers  


Tell me what does dollar sign ($) means in jquery? : jquery mobile

0 Answers  


Can we select a element having a specific class in jquery ?

0 Answers  


What is queue() in jquery?

0 Answers  


What is a jquery ajax?

0 Answers  


Can we call C# code behind using jQuery?

0 Answers  


Tell me does jquery 2.0 supports ie? : jquery mobile

0 Answers  


Categories