js 全选 全不选

引用:http://www.dwww.cn/News/2008-2/20082141545156479.shtml

 

<input name='chkAll' type='checkbox' id='chkAll' onclick='CheckAll(this.form)' value='checkbox'>

function CheckAll(form){
for (var i=0;i<form.elements.length;i++){
var e = form.elements[i];
if (e.Name != 'chkAll'&&e.disabled==false)
e.checked = form.chkAll.checked;
}
}

posted @ 2012-02-15 18:10  镇水古月  阅读(122)  评论(0编辑  收藏  举报