已经选中的变为未选中的,未选中的变为已选中的
/*反选函数*/
function fan() {
//1.获取所有多选框标签
let checkBoxObjs = document.querySelectorAll("input[type='checkbox']");
//2.遍历
for(let checkBOxObj of checkBoxObjs){
checkBOxObj.checked = !checkBOxObj.checked;//使用感叹号(否)进行反选
}
}