jQuery submit () method
Examples
When submitting a form, it displays a warning box:
$ ( "Form"). Submit (function () {
alert ( "submission");
});
alert ( "submission");
});
try it"
Definition and Usage
When submitting a form, submit event occurs.
This event is only available in <form> element.
submit () method triggers submit an event, or when a predetermined function to run the event submit events.
grammar
Trigger the selected element submit events:
$(Selector) .submit () try
Adding Functions to submit events:
$(Selector) .submit (function) try
参数 | 描述 |
---|---|
function | 可选。规定当 submit 事件被触发时运行的函数。 |
More examples
Prevent the default behavior of the submit button
How event.preventDefault () method to prevent the form is submitted.