Alex Rivera | Logout

Click a specific submit button with JQuery

Asked 2011-11-30T00:32:23.103
30

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 so I need to target a specific submit button.

How could I do that?

Edit
Report

1 Answer

5

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();
answered 2011-11-30T00:34:36.500

Your Answer