![]() |
VOOZH | about |
The onsubmit event in HTML DOM occurs after the submission of a form. The form tag supports this event.
Syntax:
<element onsubmit="Script">
object.onsubmit = function(){myScript};object.addEventListener("submit", myScript);
Example: In this example, we will see the onsubmit event using Javascript.
Output:
Example: In this example, we will see the onsubmit event using the addEventListener() method in Javascript.
Output:
We have a complete list of HTML DOM methods, to check those please go through this HTML DOM Object Complete reference article.
Supported HTML Tags: HTML <form> tag
Supported Browsers: The browsers supported by HTML DOM onsubmit Event are listed below:
We have a Cheat Sheet on Javascript where we covered all the important topics of Javascript to check those please go through Javascript Cheat Sheet-A Basic guide to JavaScript.