function _SetAllCheckBox(me)
{
var gridCheckBox = me.parentElement.parentElement.parentElement.all.tags("input");
for(var i =0; i< gridCheckBox.length;i++)
{
if(gridCheckBox[i].type == "checkbox")
{
gridCheckBox[i].checked = me.checked;
}
}
}
{
var gridCheckBox = me.parentElement.parentElement.parentElement.all.tags("input");
for(var i =0; i< gridCheckBox.length;i++)
{
if(gridCheckBox[i].type == "checkbox")
{
gridCheckBox[i].checked = me.checked;
}
}
}
本文介绍了一种在网页中通过脚本批量设置表格内所有复选框状态的方法。该方法通过查找并遍历指定元素下的所有输入字段,判断其类型是否为复选框,并将这些复选框的状态统一设置为触发元素的状态。
348

被折叠的 条评论
为什么被折叠?



