I can't understand why I cant get elements from a HtmlCollection. This code example:
var col = (document.getElementsByClassName("jcrop-holder"));
console.log(col);
produces this output on console:
I'm trying to get the dic.jcrop-holder object but i cant get it from my variable col. None of this works:
console.log(col[0]); // undefined
console.log(col.item(0)); // null
// check length of collection
console.log(col.length); // 0
So if the length is 0 why does the console show a length of 1, as well as objects inside? When I open the node it contains children. What's going on?
Here are some expanded nodes. I didn't expand div.jcrop.holder because it is too long. Here are children elements: