What does `a > b` mean?

前端 未结 4 810
无人及你
无人及你 2021-01-23 07:48

I\'m reading a tutorial about creating a shoutbox with jquery, php and ajax. In the jquery code, it creates a variable like this

var messageList = $(\".content &         


        
相关标签:
4条回答
  • 2021-01-23 08:01

    It indicates the shoutbox should be applied to a "ul" thats the immediate child of ".content". Without the ">" symbol, it applies to any ul thats a child of .content

    0 讨论(0)
  • 2021-01-23 08:03

    It's a child selector.

    0 讨论(0)
  • 2021-01-23 08:04

    css child selector

    0 讨论(0)
  • 2021-01-23 08:19

    It searches for a ul that's the direct child of .content, so if you'd change the html to

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

    your selector wouldn't return anything. There's more info on all kinds of selectors on http://api.jquery.com/category/selectors/

    0 讨论(0)
提交回复
热议问题