选择器 #id 用于搜索的,通过元素的 id 属性中给定的值 element 一个用于搜索的元素。指向 DOM 节点的标签名。 .class 一个用以搜索的类。一个元素可以有多个类,只要有一个符合就能被匹配到。 * 找到每一个元素 selector1,selector2,selectorN 你可以指定任意多个选择器,并将匹配到的元素合并到一个结果内。 层级 ancestor descendant parent > child prev + next prev ~ siblings 基本 :first :not(selector) :even :odd :eq(index) :gt(index) :lang1.9+ :last :lt(index) :header :animated :focus :root1.9+ :target1.9+ 内容 :contains(text) :empty :has(selector) :parent 可见性 :hidden :visible 属性 [attribute] [attribute=value] [attribute!=value] [attribute^=value] [attribute$=value] [attribute*=value] [attrSel1][attrSel2][attrSelN] 子元素 :first-child :first-of-type1.9+ :last-child :last-of-type1.9+ :nth-child :nth-last-child()1.9+ :nth-last-of-type()1.9+ :nth-of-type()1.9+ :only-child :only-of-type1.9+ 表单 :input :text :password :radio :checkbox :submit :image :reset :button :file :hidden 表单对象属性 :enabled :disabled :checked :selected