A form’s “action” and “onsubmit”: Which executes first?

If action was resolved first, then the browser would leave the page, the JS execution environment would go away, and there would be nowhere to run the JS in onsubmit, so it isn’t.

Event handlers run before default actions. They can cancel default actions.

Leave a Comment