<form onsubmit="myFunction()">
Enter name: <input type="text" name="fname">
<!--input type="submit" value="Submit"-->
<button onclick="alert('button click')">click</button>
</form>
press enter on input triggers button onclick, form is submitted. How to avoid button onclick trigger.