一个获取列表页面上所有CheckBox的脚本
<script language="javascript">
function SelectAllCheckboxes(spanChk)
{
// Added as ASPX uses SPAN for checkbox
var xState=spanChk.checked;
elm = spanChk.form.elements;
for(i = 0; i < elm.length; i++)
{
if(elm[i].type == "checkbox" && elm[i].id != spanChk.id)
{
//elm[i].click();
if(elm[i].checked!=xState)
elm[i].click(); //elm[i].checked=xState;
}
}
}
</script>
spanChk为页面上控制全选的CheckBox


浙公网安备 33010602011771号