我有這樣的表,它也會從一個XML填充上按一下按鈕所有複選框上的按鈕取消選中使用jQuery
<table id="tableDg"
style="border:#2F5882 1px solid;width:100%;" cellspacing="1" cellpadding="1">
<thead>
<tr id="trHead" style="color :#FFFFFF;background-color: #8EA4BB" >
<th></th>
<th width="2%"><input id="chkbHead" type='checkbox' /></th>
<th width="10%" align="center" spry:sort="name"><b>Name</b></th>
<th width="22%" align="center" spry:sort="host"><b>Host</b></th>
</tr>
</thead>
<tbody spry:repeat="pv1">
<tr class="trOdd"
spry:if="({ds_RowNumber} % 2) != 0" onclick="ds1.setCurrentRow('{ds_RowID}');"
style="color :#2F5882;background-color: #FFFFFF">
<td><input type="hidden" id="path" value="{path}"></input></td>
<td><input type="checkbox" id="chkbTest" class = "chkbCsm" ></input></td>
<td width="10%" align="center"> <input type="hidden" id="nameText" readonly="true" value="{name}"><a href="#" class="aDg">{name}</a></input></td>
<td width="22%" align="center"> <input type="hidden" id="nameText" readonly="true" value="{host}">{host}</input></td>
</tr>
<tr class="trEven" name="trEven" id="trEven"
spry:if="({ds_RowNumber} % 2) == 0" onclick="ds1.setCurrentRow('{ds_RowID}');"
style="color :#2F5882;background-color: #EDF1F5;">
<td><input type="hidden" id="path" value="{path}"></input></td>
<td><input type="checkbox" class = "chkbCsm" ></input></td>
<td width="10%" align="center"> <input type="hidden" id="nameText" readonly="true" value="{name}"><a href="#" class="aDg">{name}</a></input></td>
<td width="22%" align="center"> <input type="hidden" id="nameText" readonly="true" value="{host}">{host}</input></td>
</tr>
</tbody>
</table>
點擊我調用一個函數和函數中我做類似下面
$('#tableDg input:checkbox').removeAttr('checked');
但沒有運氣。請幫助!!我想取消按鈕的所有複選框單擊
什麼的console.log($( '#tableDg輸入:複選框'));正在顯示? – 2011-06-14 11:12:26
對不起我的錯誤。我在頁面的其他部分發生了一些錯誤。它工作正常。 – abi1964 2011-06-14 11:13:34