Let’s say I have a div called the_div. In this div there will be multiple submit buttons. The submit buttons are added dynamically on the page.
<div id="the_div">
...other stuff
<input type='submit' value='Add'>
...other stuff
<input type='submit' value='Add'>
...other stuff
<input type='submit' value='Add'> -need to select this one
</div>
Is there a way I can use a jQuery selector to select the submit button that is closest to the end of the div? In the example above it would be the third submit button.
Use last.
$('#the_div :submit:last')...