What is the opposite of evt.preventDefault();

Bryan picture Bryan · Apr 13, 2011 · Viewed 184.8k times · Source

Once I've fired an evt.preventDefault(), how can I resume default actions again?

Answer

Grant Thomas picture Grant Thomas · Apr 13, 2011

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()
});