js 实现复选框全选的代码
<script language="javascript" type="text/javascript">
function selectAll(obj)
{
var theTable =
obj.parentElement.parentElement.parentElement;
var i ;
var j = obj.parentElement.cellIndex;
for(i =0 ; i<theTable.rows.length;i++)
{
var objCheckBox = theTable.rows[i].cells
[j].firstChild;
if(objCheckBox != null)
{
objCheckBox.checked = obj.checked;
}
}
}
</script>