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

Usage examples and precautions when the selector contains spaces_jquery

WBOY
Release: 2016-05-16 17:27:31
Original
929 people have browsed it
Principle explanation:

var $t_a=$(".test :hidden") //The space indicates that the class is selected as the hidden element in test;
var $t_a =$(".test:hidden")//Without spaces, it means selecting hidden elements with class test;

Example:
Copy code The code is as follows:








< ;div class="test" style="display:none;">

dddddddd


dddddddd







The output results are: 2 and 3 respectively;
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!