arrays - jquery .find('input').each -


i have row contains inputs down few descendants. trying capture values of children inputs when button within row clicked. can use values further down line not sure how extract values properly. suggestions on have?

    <div class="row">          <div class="form-horizontal">         <div class="col-md-6">           <div class="form-group">             <div class="col-sm-10"><input type="text" value='0' class="form-control" > </div></div>      <div class="col-sm-offset-2 col-sm-10">                               <button type="button" class="btn btn-default updatebutton">update</button>                             </div></div></div></div>  $('.updatebutton').on('click', function () {         var inputs = [];         $(this).parent('.row').find('input').each(function (i) {             inputs.push($(this).val());         }); 

if understand correctly, close. want this:

$('.updatebutton').on('click', function() {     var inputs = [];     $(this).closest('.row').find('input').each(function() {         inputs.push($(this).val());     }); }); 

Comments