John Resign
George Martin
Malcom John Sinclair
J.Ohn
1. :contains(text)
Select elements with text content "text"
$("div:contains('John')").addClass("highlight"); //Find all div elements containing "John"
2. :empty
Select an empty element that does not contain any child elements or text
Use the chrome browser to inspect the element and you will find that the class style of the div empty has been changed
$("div:empty").addClass("highlight ");
3. :has(selector)
Select the element containing the element matched by the selector
$("div:has(p)").addClass("highlight") ; //Find all div elements containing p
4. :parent
Select element tags containing child elements or text
$("div:parent").addClass(" highlight"); //Find all div elements containing child elements or text
Statement: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