What does `a> b` mean?

I am reading a tutorial on creating crickbox with jquery, php and ajax. In jquery code, it creates a type variable

var messageList = $(".content > ul");

There is a content class in html and it has an unordered list. But I do not understand the syntax .content > ulwhen creating a variable.

Can you explain?

HTML

 <div class="content">  
            <h1>Latest Messages</h1>  
            <div id="loading"><img src="css/images/loading.gif" alt="Loading..." /></div>  
            <ul>  
            <ul>  
        </div>  
+1
source share
4 answers

It is looking for ulwhich is a direct child .content, so if you change the html to

<div class="content">
   <div>
      <ul></ul>
   </div>
</div>

your selector will not return anything. There is more information about all kinds of selectors at http://api.jquery.com/category/selectors/

+1
source

, "ul", ".content". " > " , .content

+2

This is a child selector .

+1
source
+1
source

All Articles