1.jquery语法
1.1:$(this) 当前HTML元素 2.$("p") 所有<P>元素 3 $("p.intro");所有class=intro的<P>元素
1.4..$(".intro")所有class=intro的元素. 5.$("#intro") id=intro的元素 6.$("ul li:first")每个UL里面第一个li元素 7.$("[href$='.jpg']"); 所有带有.JPG结尾的属性值的href属性
1.8 $("div#intro.head") id="intro" 中的div里面所有class="head"的元素..
语法 | 描述 |
---|---|
$(this) | 当前 HTML 元素 |
$("p") | 所有 <p> 元素 |
$("p.intro") | 所有 class="intro" 的 <p> 元素 |
$(".intro") | 所有 class="intro" 的元素 |
$("#intro") | id="intro" 的元素 |
$("ul li:first") | 每个 <ul> 的第一个 <li> 元素 |
$("[href$='.jpg']") | 所有带有以 ".jpg" 结尾的属性值的 href 属性 |
$("div#intro .head") | id="intro" 的 <div> 元素中的所有 class="head" 的元素 |
點(diǎn)擊查看更多內(nèi)容
為 TA 點(diǎn)贊
評論
評論
共同學(xué)習(xí),寫下你的評論
評論加載中...
作者其他優(yōu)質(zhì)文章
正在加載中
感謝您的支持,我會繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦