@samuel-adu
Posted
event.preventDefault()
event.preventDefault() is a method in JavaScript that prevents the default action associated with an event from occurring.
The default action when a form is submitted is for the browser to send the form data to the server and reload the page, to prevent the page from reloading we use the event.preventDefault() method.
Marked as helpful
@dimitrisdr
Posted
Thanks a lot @samuel-adu !