<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div>
<input type="checkbox" name="" id="resverse">反选
<div id="weeks">
<input type="checkbox" value="1">
<input type="checkbox" value="2">
<input type="checkbox" value="3">
<input type="checkbox" value="4">
<input type="checkbox" value="5">
<input type="checkbox" value="6">
<input type="checkbox" value="7">
<input type="checkbox" value="8">
<input type="checkbox" value="9">
</div>
</div>
</body>
<script src="js/jquery.min.js"></script>
<script>
$('#resverse').click(function () {
$('#weeks :checkbox').each(function() {
$(this).prop("checked", !$(this).prop("checked"));
});
})
</script>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div>
<input type="checkbox" name="" id="resverse">反选
<div id="weeks">
<input type="checkbox" value="1">
<input type="checkbox" value="2">
<input type="checkbox" value="3">
<input type="checkbox" value="4">
<input type="checkbox" value="5">
<input type="checkbox" value="6">
<input type="checkbox" value="7">
<input type="checkbox" value="8">
<input type="checkbox" value="9">
</div>
</div>
</body>
<script src="js/jquery.min.js"></script>
<script>
$('#resverse').click(function () {
$('#weeks :checkbox').each(function() {
$(this).prop("checked", !$(this).prop("checked"));
});
})
</script>
</html>