重置按钮
<input type="checkbox">游泳
<input type="checkbox">爬山
<input type="checkbox">跑步
<input type="checkbox">网球
<input type="checkbox">骑行
<button>重置</button>
<!–prop()方法的使用:使用具有 true 和 false 两个属性的属性–>
<script>
$(function () {
$("button").click(function () {
$("input:checkbox").each(function () {
if(this.checked==true){
$(this).prop("checked",false); //checked, selected 或者 disabled 使用prop()
}
})
})
})
</script>