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

Explanation of the role of the jQuery greater than sign (>) selector_jquery

WBOY
Release: 2016-05-16 16:20:28
Original
1342 people have browsed it

What is the role of the greater than sign in jQuery selector>:
jQuery's flexible and diverse selectors are one of the advantages of jQuery.
Let's introduce one of the selectors, represented by the greater than sign.
The code example is as follows:

Copy code The code is as follows:





Ant Tribe


<script><br> $(document).ready(function(){<br> $("#box>div").css("background-color","green");<br> });<br> </script>









The above code can set the background color of the first-level div sub-element under the box element to green.
That is to say, the selector matches the first-level child elements of the specified element, not all descendant elements.

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