how to create a function for the submit button in html code example
Example: how to use form on submit in html
<form onsubmit="myFunction()">
Enter name: <input type="text">
<input type="submit">
</form>
<form onsubmit="myFunction()">
Enter name: <input type="text">
<input type="submit">
</form>