jQuery 常規(guī)選擇器

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


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

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)