anak -anak array javascript

var foo = document.getElementById('foo');
for (var i = 0; i < foo.children.length; i++) {
    console.log(foo.children[i].tagName);
}
Plain Peacock