html input type submit onsubmit 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>