HTML onsubmit event properties
Examples
Run the script when the form is submitted:
<form action="demo_form.html" onsubmit="checkForm()">
try it"
Browser Support
All major browsers support onsubmit event attributes
Definition and Usage
onsubmit attribute triggered when the form is submitted.
onsubmit attribute applies only <form> element.
Differences between HTML 4.01 and HTML5
no.
grammar
<form onsubmit=" script ">
Property Value
值 | 描述 |
---|---|
script | 规定该onsubmit事件触发时执行的脚本。 |
HTML Event Attributes