我有很多這樣的輸入字段的形式,查找下一個輸入框,並將焦點,如果它是jQuery的空阱
我試圖循環具有名稱distanceSlabCost
元素$(":text[name^=distanceSlabCost]").each(function(i){
var curTxtBox = $(this);
var nextTxtBox = // find the next text field (?)
var nextTxtFieldId // find the id of next text field (?)
});
如何獲取下一個textField元素的id? 另外,如果下一個字段的值爲空,則將焦點設置爲該字段。
http://stackoverflow.com/questions/7305100/filter-elements-by-class-name- and-value-jquery/7305125#7305125 – NimChimpsky