finden Sie das nächste Feld, welches im nächsten div-jquery
Ich bin immer das Letzte element in der form, das hat Wert, das will ich jetzt finden Sie die id des nächsten input-element, welches im nächsten div...
var elem1 =$(':text[name^=distanceSlab][value!=""]').last();
var nextElemId = //find the id of next input element which is in next div
den entsprechenden html-code ist
<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>
Du musst angemeldet sein, um einen Kommentar abzugeben.
Davon aus, dass Sie ausgehend von der
input
, dass Sie bereits identifiziert, dann:JS Fiddle.
Oder:
JS Fiddle.
Ich würde wahrscheinlich die in einen
blur()
oder ähnliche Veranstaltung.