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
In what scenarios jQuery can be used?
How to add and remove css classes to an element using jquery?
Define data paremeter of jquery ajax method?
Tell me what does $("div") will select? : jquery mobile
How to create, read and delete cookies with jquery?
What are selectors in jquery?
How to read cookies in jquery?
What is the use of clone method in jQuery?
Is jquery a library for client scripting or server scripting? : jquery mobile
Why is not dom ready working for jquery mobile? : jquery mobile
Why should I use jquery?
Is jquery a framework?
Is window.onload is different from document.ready()?
How you get server response from an ajax request using jquery?
What is queue() in jquery?