I have a div with 4 checkbox. Then I run the following javascript:
var elements = document.getElementById('myDiv').getElementsByTagName('input');
alert(elements.length); // output: 4
for (element in elements) {
alert(element);
}
alert('finish!');
After the 4, I get the following alerts, in that order:
0
1
2
3
item
namedItem
length
finish!
The numbers from 0 to 3 are the indexes of elements. But what does 'item', 'namedItem' and 'length' mean here?