开发者

Get nested tags using Mootools

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");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜