`a>是什么b是什么意思? [英] What does `a > b` mean?
问题描述
我正在阅读有关使用jquery,php和ajax创建shoutbox的教程.在jquery代码中,它会创建一个像这样的变量
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 > ul");
html中有一个内容"类,并且其中有一个无序列表.但是我不了解变量创建中的语法.content > ul
.
There is a "content" class in the html, and it has an unordered list in it. But I don't understand the syntax .content > ul
in the creation of the variable.
你能解释吗?
HTML
<div class="content">
<h1>Latest Messages</h1>
<div id="loading"><img src="css/images/loading.gif" alt="Loading..." /></div>
<ul>
<ul>
</div>
推荐答案
它将搜索ul
是.content
的 direct 子级,因此如果将html更改为
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>
您的选择器不会返回任何内容.有关 http://api.jquery.com/category/selectors/
your selector wouldn't return anything. There's more info on all kinds of selectors on http://api.jquery.com/category/selectors/
这篇关于`a>是什么b是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!