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

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -