1、基本選擇器:
創(chuàng)新互聯(lián)公司始終堅(jiān)持【策劃先行,效果至上】的經(jīng)營(yíng)理念,通過(guò)多達(dá)十多年累計(jì)超上千家客戶的網(wǎng)站建設(shè)總結(jié)了一套系統(tǒng)有效的全網(wǎng)營(yíng)銷推廣解決方案,現(xiàn)已廣泛運(yùn)用于各行各業(yè)的客戶,其中包括:成都混凝土泵車(chē)等企業(yè),備受客戶稱譽(yù)。
#id 、element 、.class 、* 、selector1,selector2,selectorN
2、層次選擇器:
ancestor descendant 、parent child 、prev + next 、prev ~ siblings
3、基本過(guò)濾器選擇器
:first 、:last 、:not 、:even 、:odd 、:eq 、:gt 、:lt 、:header 、
:animated
4、內(nèi)容過(guò)濾器選擇器
:contains 、:empty 、:has 、:parent
5、可見(jiàn)性過(guò)濾器選擇器
:hidden 、:visible
6、屬性過(guò)濾器選擇器
[attribute] 、[attribute=value] 、[attribute!=value] 、[attribute^=value] 、[attribute$=value] 、[attribute*=value] 、[attrSel1][attrSel2][attrSelN]
7、子元素過(guò)濾器選擇器
:nth-child 、:first-child 、:last-child 、:only-child
8、表單選擇器
:input 、:text 、:password 、:radio 、:checkbox 、:submit 、:image 、:reset 、:button
、:file 、:hidden
9、表單過(guò)濾器選擇器
:enabled 、:disabled 、:checked 、:selected
!DOCTYPE?html
html
head
titleDemo/title
/head
body
div?name?=?"userName"?id?=?"div1"/div
div?name?=?"please"?id?=?"div2"/div
div?name?=?"bike"?id?=?"div3"/div
div?name?=?"thanks"?id?=?"div4"/div
/body
script
src=""
integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
crossorigin="anonymous"/script
script?type="text/javascript"
var?$name1?=?$("[name='userName']");//?獲取name屬性的值等于userName的頁(yè)面元素
var?$name2?=?$("[name^='p']");//?獲取name屬性的值以p為首字母的頁(yè)面元素
var?$name3?=?$("[name$='e']");//?獲取name屬性的值以e結(jié)尾的頁(yè)面元素
var?$name4?=?$("[name*='a']");//?獲取name屬性的值包含a的頁(yè)面元素
console.log($name1,$name2,$name3,$name4)
/script
/html
這些屬性選擇器在jquery官方文檔上都有示例和詳細(xì)的描述
網(wǎng)頁(yè)鏈接
jquery屬性選擇器中屬性指的是元素的屬性,比如input 的input;a color=""的color。
新聞名稱:jquery選擇器屬性,jq的屬性選擇器
標(biāo)題路徑:http://chinadenli.net/article34/dsdsgpe.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設(shè)計(jì)公司、企業(yè)建站、微信公眾號(hào)、網(wǎng)站策劃、營(yíng)銷型網(wǎng)站建設(shè)、軟件開(kāi)發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)