As you said, preventDefault prevents the event action from triggering by default. The default action of an event depends on the type of event and the purpose of the event.
For example, if preventDefault was used in the click event handler for a flag, the flag will not be checked on click. If it was used in the keydown event keydown to enter text, the key pressed would not be written to the input value. If it was used in the submit event handler for the form, this would prevent the form from submitting.
Basically, it stops any event from executing the action that it performed by default.
source share