jQuery-选择器

大城市里の小女人 提交于 2019-11-27 14:00:19
选择器解释
$(“p”) 选择标签
$(".test") 选择类
$("#test") 选择id
$(“p.intro”) p标签里class为intro
$(“p:first”) p的第一个
$(“ul li:first”) 第一个ul的第一个li
$(“ul li:first-child”) 每一个ul的第一个li
$("*") 所有
$(this) 表示当前
$(“tr:even”) 偶数位的tr元素
$(“tr:odd”) 奇数位的tr元素
$(“p:nth-child(3)”) 第3个p
$(":button") type是button的
$("[href]") 带有herf属性的
$(“a[target=’_blank’]”) target为blank的
$(“a[target!=’_blank’]”) target不为blank的
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!