Easy Tutorial
❮ Sel Animated Event Isimmediatepropagationstopped ❯

jQuery submit() Method

jQuery Event Methods

Example

Display an alert box when the form is submitted:

$("form").submit(function(){ alert("Submitted"); });

Definition and Usage

The submit event occurs when a form is submitted.

This event only applies to <form> elements.

The submit() method triggers the submit event, or specifies a function to run when a submit event occurs.


Syntax

Trigger the submit event for the selected elements:

Attach a function to the submit event:

Parameter Description
function Optional. Specifies a function to run when the submit event is triggered.

More Examples

Prevent the default action of the submit button


jQuery Event Methods

❮ Sel Animated Event Isimmediatepropagationstopped ❯