4
我正在獲取已獲得值的表單的最後一個元素,現在我想要查找下一個div中的下一個輸入元素的id ...找到下一個div-jquery中的下一個輸入字段
var elem1 =$(':text[name^=distanceSlab][value!=""]').last();
var nextElemId = // find the id of next input element which is in next div
相應的HTML代碼
<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>