How to select a certain element that is closest to the end of a given div with jQuery? -
let's have div called the_div. in div there multiple submit buttons. submit buttons added dynamically on 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 select 1 </div> is there way can use jquery selector select submit button closest end of div? in example above third submit button.
use last.
$('#the_div :submit:last')...
Comments
Post a Comment