我有几个具有相同类名称的div。但有不同的内容。他们就像如下JQuery:迭代相同的类名称
<div class="schoolLib">
<div class="message">
<span class="msgTextLib">This is a sample text.</span>
</div>
</div>
<div class="schoolCanteen">
<div class="message">
<span class="msgTextcanteen">This is another sample text.</span>
</div>
</div>
<div class="schoolBus">
<div class="message">
<span class="msgTextBus">This is a sample text for Bus.</span>
</div>
</div>
我怎样才能使用的.html进去消息类的DIV中的所有文本()。我的内容正在动态发展。我有不同的跨班级。另外我需要使用.html()为所有div设置不同的文本。所以我需要一种方法来迭代地获取类名消息下的所有内容。我知道.each()方法,但不知道如何做到这一点。作为初学者,我需要你的帮助。我会很感激你的帮助。
太基本了,请使用Google关于如何使用'.each()'。另外这里是jQuery文档... http://api.jquery.com/jQuery.each/ – Dom 2013-03-26 16:57:30