Click a specific submit button with JQuery

前端 未结 6 1361
温柔的废话
温柔的废话 2021-02-05 03:33

I am clicking a submit button using this:

$(\'input[type=submit]\').click(); 

The problem is that I have more that 1 submit button on my page s

6条回答
  •  渐次进展
    2021-02-05 03:36

    Add ids to each button and select the id with jQuery.

    Or, if the forms have ids, then just target the form and submit it like so:

    $("#form-id").submit();
    

提交回复
热议问题