What is the opposite of evt.preventDefault();

As per commented by @Prescott, the opposite of:

evt.preventDefault();

Could be:

Essentially equating to ‘do default’, since we’re no longer preventing it.

Otherwise I’m inclined to point you to the answers provided by another comments and answers:

How to unbind a listener that is calling event.preventDefault() (using jQuery)?

How to reenable event.preventDefault?

Note that the second one has been accepted with an example solution, given by redsquare (posted here for a direct solution in case this isn’t closed as duplicate):

$('form').submit( function(ev) {
     ev.preventDefault();
     //later you decide you want to submit
     $(this).unbind('submit').submit()
});

Leave a Comment