In the following page, with Firefox the remove button submits the form, but the add button does not.
How do I prevent the remove
button from submitting t
Just add e.preventDefault();
in your method should prevent your page from submitting forms.
function myFunc(e){
e.preventDefault();
}
According to the MDN Web Docs
The preventDefault () method of the Event interface tells the user agent that if the event is not explicitly processed, its default action should not be taken into account as it would normally be. The event continues to propagate as usual, unless one of its listeners calls
stopPropagation ()
orstopImmediatePropagation ()
, either of which terminates the propagation.