首頁  >  選擇器  > :not(selector)

返回值:Array<Element(s)>:not(selector)

jQuery :not() 選擇器概述

去除所有與給定選擇器匹配的元素

在jQuery 1.3中,已經(jīng)支持復(fù)雜選擇器了(例如:not(div a) 和 :not(div,a))

參數(shù)

selectorSelectorV1.0

用于篩選的選擇器

示例

描述:

查找所有未選中的 input 元素

HTML 代碼:
<input name="apple" />
<input name="flower" checked="checked" />
jQuery 代碼:
$("input:not(:checked)")
結(jié)果:
[ <input name="apple" /> ]