How to prevent buttons from submitting forms

后端 未结 17 2107
礼貌的吻别
礼貌的吻别 2020-11-21 04:43

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

17条回答
  •  -上瘾入骨i
    2020-11-21 05:20

    Set your button in normal way and use event.preventDefault like..

         
       ...
       ...
    
       In function...
    
       function myFunc(e){
           e.preventDefault();
       }
    

提交回复
热议问题