What is event preventDefault () and event stopPropagation () in Jquery?

The preventDefault() function is used to prevent the default action the browser performs on that event, whereas the stopPropagation() method stops the game from bubbling up to the event chain. The divs click handler never works with stopPropagation(). With preventDefault(), the divs click handler works but browsers default action gets stopped.

Suggest An Answer

No suggestions avaliable!

Latest post from JQuery interview questions

Ask Question