<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>:not(selector)</title>
</head>
<script src="jquery-3.1.1.js">
</script>
<body>
<!--
去除所有与给定选择器匹配的元素
在jQuery 1.3中,已经支持复杂选择器了(例如:not(div a) 和 :not(div,a))
-->
<input name="apple" />
<input name="flower" checked="checked" id="a" />
<div>divdiv</div>
<a>aaa</a>
</body>
<script type="text/javascript">
//$("input:not(:checked)").css('background','purple');
//显示结果不正确[测试好多次,用了几个库都不能执行正确结果,不知道自己的问题还是什么原因,加了id之后,用id做选择器是好用的,如下]
//$("input:not(#a)").css('background','purple');显示结果正确
$(":not('input')").css('background','#666');
</script>
</html>