jquery点击li,判断复选框是否选中,结果打印结果出现false和true两种,是哪里错了?
代码如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
</head>
<body>
<ul class="qul">
<li>
<label>
<input type="checkbox">
<span>测试</span>
</label>
</li>
</ul>
<script>
$('.qul li').click(function(){
var isChecked=$(this).find('input').prop('checked');
console.log(isChecked);
});
</script>
</body>
</html>
打印结果如图