I get the last form element that received the value, now I want to find the identifier of the next input element, which is in the next div ...
var elem1 =$(':text[name^=distanceSlab][value!=""]').last(); var nextElemId = // find the id of next input element which is in next div
corresponding html code
<div id ="divid4"> <input type="text" id ="slab4" value ="1"/> // this is the last elemnt which has value </div> <div id ="div1d5"> <input type="text" id ="slab5" value =""/> // need to find the id of this element </id>
source share