开发者

Get nested tags using Mootools

开发者 https://www.devze.com 2023-02-09 03:36 出处:网络
I have HTMl structure as follows <div class=\"comments_options\" id=\"comment_2\"> <span>2 comments</span>

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

精彩评论

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