html onsubmit form code example
Example: onsubmit in html
<form onsubmit="myFunction()">
Enter name: <input type="text">
<input type="submit">
</form>
<script>
function myFunction() {
alert("The form was submitted");
}
</script>
<form onsubmit="myFunction()">
Enter name: <input type="text">
<input type="submit">
</form>
<script>
function myFunction() {
alert("The form was submitted");
}
</script>