js实现全选功能
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script type="text/javascript">
function show1(){
if(document.getElementById("c1").checked){
document.getElementById("c2").checked=true;
document.getElementById("c3").checked=true;
}else{
document.getElementById("c2").checked=false;
document.getElementById("c3").checked=false;
}
}
</script>
</head>
<body>
<input type="checkbox" id="c1" onclick="show1()">全选
<input type="checkbox" id="c2" >
<input type="checkbox" id="c3">
</body>
</html>