jquery--checkbox全选/全不选
<input type="checkbox" id="boxid" onclick="setAllNo()" />全选/全不选
# 渲染多选数据
for (i = 0; i < data.length; i++) { envHtml += '<input type="checkbox" name="env" value="'+data[i]['id']+'"/>' +data[i]["name"] }
function setAllNo() { var box = document.getElementById("boxid"); var loves = document.getElementsByName("env"); if (box.checked == false) { for (var i = 0; i < loves.length; i++) { loves[i].checked = false; } } else { for (var i = 0; i < loves.length; i++) { loves[i].checked = true; } } }
python 中文名:蟒蛇,设计者:Guido van Rossum