jQuery submit() Event

jQuery submit event triggers when the user attempts to submit a form. This event is only used in the form element, while submitting a form.

Syntax of submit() Event


The selector is the element on click the submit event trigger. The function is an optional parameter. This function is called when the user hits the submit button.


<form id="frm">
<input type="submit" value="Submit" />

alert("This submit event called.");  

Output of the above code

In the above example, an alert message is displayed when the user submits the form of id 'frm'.