Home > Web Front-end > JS Tutorial > jQuery: Difference analysis of whether there is a space before nth-child_jquery

jQuery: Difference analysis of whether there is a space before nth-child_jquery

WBOY
Release: 2016-05-16 18:04:56
Original
1043 people have browsed it

Then, I wrote the following html:




12




                                                                        td>31


The expected effect is:




So I wrote the following jQ:

$(".a:nth-child(2)").css("color","red");

The result of running the operation is actually: jQuery: Difference analysis of whether there is a space before nth-child_jquery

I am puzzled. . Finally, I found that JQ was rewritten as:

$(".a :nth-child(2)").css("color","red");

That’s it. jQuery: Difference analysis of whether there is a space before nth-child_jquery

Note: There is a space after a! ! !

Although the problem has been solved, I don’t know the cause. Please give me some guidance. . .

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
11 13
21 32