How to prevent a button to submit the form? code example Example: prevent button from submitting form function myFunc(e){ e.preventDefault(); }