我有一些標記:如何基於類改變一個隱藏的價值有
<table>
<tbody>
<tr>
<td>
<input type="hidden" class="deleted" value="False" />
<input type="button" class="rtButton" value="RT" />
</td>
</tr>
<tr>
<td>
<input type="hidden" class="deleted" value="False" />
<input type="button" class="rtButton" value="RT" />
</td>
</tr>
<tr>
<td>
<input type="hidden" class="deleted" value="False" />
<input type="button" class="rtButton" value="RT" />
</td>
</tr>
</tbody>
</table>
什麼,我想發生時rtButton點擊在同一只隱藏輸入的值td更改爲true。
我試圖實現這一目標:
$(function(){
$('.rtButton').click(function() {
$(this).closest('input.deleted').val("True");
alert($(this).closest('input.deleted').val())
});
});
然而,它似乎無法設置的值。
你或許應該被應用名稱全部你的輸入字段(如果你是ver實際上是想發佈數據)。 – 2012-08-07 21:55:52