What is the difference between event.PreventDefault and event.stopPropagation?
Answer Posted / 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 View All Answers
How to check if number is numeric while using jquery 1.7+? : jquery mobile
How to use jquery library in our asp.net project?
How can you add a jquery library in your project?
Is jquery a framework?
How to execute jQuery code after the DOM is ready?
What are the advantages of minified version of jquery?
How to find all sibling elements after the current element using ?
Can JQuery Run on MAC or Linux instead of Windows?
What is the difference between $(this) and 'this' in jquery?
How to check data type of any variable in jquery? : jquery mobile
Why html 5 inputs look different across devices and browsers? : jquery mobile
Explain chaining in jquery? : jquery mobile
How to use jquery?
Is it possible that jquery html work for both html and xml document?
Tell me how to use migrate jquery plugin if possible? : jquery mobile