JavaScript Tutorial in Hindi for Beginners [Part 64] - Prevent Default in JavaScript
In this video i will talk about Prevent Default in JavaScript. The event.preventDefault() method stops the default action of an element from happening. For example: Prevent a submit button from submitting a form Prevent a link from following the URL The Event interface's preventDefault() method tells the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be. The event continues to propagate as usual, unless one of its event listeners calls stopPropagation() or stopImmediatePropagation(), either of which terminates propagation at once.