我有下表,其中包含每個行中的複選框。當複選框狀態發生變化時(選中/取消選中),相應的行需要以黃色突出顯示。我們如何使用jQuery實現它?我正在使用jQuery 1.4.1? 「on」不受支持。jQuery:突出顯示錶格行上覆選框更改事件
注:我想學習jQuery。請不要建議任何第三方插件。我正嘗試通過手工編碼來了解它。
<html>
<table class="commonGrid" cellspacing="0" id="detailContentPlaceholder_grdGarnishmentState"
style="border-collapse: collapse;">
<thead>
<tr>
<th scope="col">
<a >
Country Code</a>
</th>
<th scope="col">
<a >
State</a>
</th>
<th scope="col">
Independent Order Status
</th>
<th scope="col">
Standard Order Status
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
USA
</td>
<td>
<span id="detailContentPlaceholder_grdGarnishmentState_lblState_0">Alaska</span>
</td>
<td>
<span class="independantOrder">
<input id="detailContentPlaceholder_grdGarnishmentState_chkIndependentOrderStatus_0"
type="checkbox" name="ctl00$detailContentPlaceholder$grdGarnishmentState$ctl02$chkIndependentOrderStatus"
checked="checked" /></span>
</td>
<td>
<span class="standardOrder">
<input id="detailContentPlaceholder_grdGarnishmentState_chkStandardOrderStatus_0"
type="checkbox" name="ctl00$detailContentPlaceholder$grdGarnishmentState$ctl02$chkStandardOrderStatus"
checked="checked" /></span>
</td>
</tr>
<tr style="background-color: #E5E5E5;">
<td>
USA
</td>
<td>
<span id="detailContentPlaceholder_grdGarnishmentState_lblState_1">Arkansas</span>
</td>
<td>
<span class="independantOrder">
<input id="detailContentPlaceholder_grdGarnishmentState_chkIndependentOrderStatus_1"
type="checkbox" name="ctl00$detailContentPlaceholder$grdGarnishmentState$ctl03$chkIndependentOrderStatus" /></span>
</td>
<td>
<span class="standardOrder">
<input id="detailContentPlaceholder_grdGarnishmentState_chkStandardOrderStatus_1"
type="checkbox" name="ctl00$detailContentPlaceholder$grdGarnishmentState$ctl03$chkStandardOrderStatus"
checked="checked" /></span>
</td>
</tr>
</tbody>
</table>
</html>
你有2個checboxes ....如果兩者都檢查? –
不得不喜歡那些ASP.NET Id morfs :) –
@MarkSchultheiss我一直在尋找一個cssclass把選擇器或東西在身份證...但無法找到沒有... :) –