0
我有以下的HTML,我想验证:如何让孩子们元素
<div class="project-counts-nav-wrapper" style="">
<ul id="project-counts" class="project-counts-nav" style="">
<li style="">0 active projects</li>
<li style="">0 draft projects</li>
<li style="">
0 archived projects (
<a href="/projects_archived">View</a>
)
</li>
</ul>
</div>
如何获得文本值的每个“礼”标签元素?
我有以下实习生的js代码:
.findByCssSelector('#project-counts')
.findAllByTagName('li')
.then(function(children){
console.info('Show children length: ' + children.length);
console.info('children: ' + children);
for(var i=0; i<3; i++){
// how do I get text for each element
console.info('Show children: ' + children[i];
}
}).end();
我看到输出如下:
Show children length: 3
children: [object Object],[object Object],[object Object]
Show children: [object Object]
Show children: [object Object]
Show children: [object Object]
我想获得:
0 active projects
0 draft projects
0 archived projects
谢谢, 布拉德
谢谢您的回答/回复。我需要这个在Intern/Leadfoot模块中工作。我计算出来并将发布解决方案。 – bkuhl 2015-02-07 01:56:51