Home > Web Front-end > JS Tutorial > How to use jQuery contains filter to achieve exact matching_jquery

How to use jQuery contains filter to achieve exact matching_jquery

WBOY
Release: 2016-05-16 17:37:18
Original
1329 people have browsed it

Copy code The code is as follows:



















$(".selector:contains('xx')")
contains() only performs matching search, which is not accurate enough. It contains the selector and xx of xx All selectors containing xxabc will be found.

Solution:
?$(".selector:contains('xx')[innerHTML='xx']")
This will find the selector whose content is only xx.
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