Home > Web Front-end > JS Tutorial > What are jquery selectors?

What are jquery selectors?

一个新手
Release: 2017-09-21 10:51:56
Original
1649 people have browsed it


Basic Selector

$("pId")id选择器$("a")  
元素选择器$(".class1")  
类选择器$("*")  
所有选择器$("#pId,a,.class2")  ","间隔
Copy after login

Hierarchical Selector

$(.class p)子代
$(.class>li)直接子结点
$(#id+img)id后面的img
$(#id~[title])带有title属性的id
Copy after login

Basic Filter

$("tr:first")tr第一行
$("tr:last")tr最后一行
$("input:not(:chose)")查找所有未选中的input
$("tr:even")奇数行$("tr:odd")偶数行
$("tr:eq(1)")查找tr的第二行
$("tr:qt()")大于索引值
$("tr:lt()")小于索引值
$(":header")选择所有h1,h2,h3一类的header
Copy after login

The above is the detailed content of What are jquery selectors?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template