Click a specific submit button with JQuery

前端 未结 6 1344
温柔的废话
温柔的废话 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:51

    One other suggestion!

    I had a form with multiple submits, that also had varying value attributes, so I couldn't simply submit the form after I performed my built in confirmation.

    Instead, I added a few hidden buttons that I forced a click on after I got a Yes back from my confirmation.

    Here are the buttons:

    
    
    
    
    

    And here's the jQuery:

    
    

提交回复
热议问题