Home > Web Front-end > JS Tutorial > body text

What content filters does jquery have?

藏色散人
Release: 2021-01-25 16:07:46
Original
2646 people have browsed it

There are 4 types of jquery content filters, namely: 1. ":contains(text)" filter; 2. ":empty" filter; 3. ":has(selector)" filter ;4. ":parent" filter.

What content filters does jquery have?

The operating environment of this tutorial: Windows 7 system, jquery version 1.12, Dell G3 computer.

Recommended: "jquery tutorial"

jquery content filter:

Content filter is included through DOM elements Filter text content and whether it contains matching elements. There are four types of content filters: contains(text), :empty, :has(selector) and :parent, as shown in the following table.

Filter Description Example
:contains(text) Match elements that contain the given text $("li:contains('DOM')") //Match li elements that contain "DOM" text content
:empty Matches all empty elements that do not contain sub-elements or text $("td:empty") //Match units that do not contain sub-elements or text Grid
:has(selector) Matches elements containing elements matched by the selector $("td:has(p)") //Match cells containing

tags in the cells of the table

:parent Match elements containing child elements or text $("td: parent") //Match cells that are not empty, that is, the cell also includes sub-elements or text

More programming related For knowledge, please visit: programming teaching! !

The above is the detailed content of What content filters does jquery have?. 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