我有一張5 x 5的表格。每個單元格都是一個asp.net文本框。 我想用非空文本框獲取最後一行的5個文本框值。 例如:無法通過jQuery獲取html表格中的兄弟值
這應該讓地獄啊,我FRIE ND
但我得到的所有值,但最後一個(ND)。我不知道爲什麼。這裏是我的代碼:
// RIGHT HERE, $(this) referes to the whole table
$(this).find('input[value!=""]')
// I get the last edited textbox
.last()
// Go up to the parent <td>
.parent('td')
.siblings('td')
// I get all my brothers of type input
.children(':input')
.each(function() {
alert($(this).val());
});
我做錯了什麼,但什麼? 謝謝。
這個工程。謝謝 !! – anmarti