I have HTMl structure as follows
<div class="comments_options" id="comment_2">
<span>2 comments</span>
</div>
In Mootools we can collect the comment count based on style class as follows,
var commentCount =开发者_Python百科 $$('.comments_options span')[0];
How can we do the same according to id attribute
Thanks
Use getElement
document.id("comment_2").getElement("span");
or getFirst
document.id("comment_2").getFirst("span");
精彩评论