button not stopping from submit html with type button code example Example: prevent button from submitting form function myFunc(e){ e.preventDefault(); }