delete button confirm javascript on button type submit code example Example: prevent button from submitting form function myFunc(e){ e.preventDefault(); }