| 选择器 | 解释 |
|---|---|
| $(“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的 |
来源:https://www.cnblogs.com/yangjiale/p/11366715.html