jQuery 常規(guī)選擇器

2018-07-25 14:20 更新
$("*")
選擇所有結(jié)點
(“#id”)
ID選擇器,注意其中的一些特殊字符,比如 .
(“.class”)
類選擇器
(“tag”)
按標簽選擇
(“ancestor descendant”)
選擇子元素
(“parent > child”)
選擇直接子元素
:focus
獲取焦點元素
:first-child :last-child
選擇第一個/最后一個子元素
:first :last
截取第一個/最后一個符合條件的元素
(“prev + next”)
直接兄弟元素
(“prev ~ siblings”)
兄弟元素
:nth-child()
索引選擇,索引從 1 開始 :nth-child(odd) :nth-child(even) :nth-child(4n)


以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號