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