Can I make a <button> not submit a form?

前端 未结 8 1364
耶瑟儿~
耶瑟儿~ 2020-11-22 05:36

I\'ve got a form, with 2 buttons



8条回答
  •  暖寄归人
    2020-11-22 06:01

    The default value for the type attribute of button elements is "submit". Set it to type="button" to produce a button that doesn't submit the form.

    
    

    In the words of the HTML Standard: "Does nothing."

提交回复
热议问题