2016-04-12 11:22:06
<body>
<input name="apple" />
<input name="orange" />
<input name="flower" checked="checked" />
</body>
<script type="text/javascript">
$(function(){
$('input:not(:checked)').each(function(){
alert(this.name);
});
});
</script>
为什么把所有的input都打印出来了?应该是未checked的才打印呢? 看看下面就明白了: