焉知愚之乐
saojipo.com

Javascript全选/取消全选操作

js代码:

function checkAll() {
    for(var a = document.getElementById("checkAll"), b = document.getElementsByName("checkOne"), c = 0; c < b.length; c++) 
    b[c].checked = 1 == a.checked ? !0 : !1
}

Demo:

赞(0)

评论 抢沙发

评论前必须登录!