You are doing it wrong. This is not valid HTML, because it is required that all values of all
id
elements should be unique in the document. To start with, you have to remove
id="skillDiv"
or make all values unique.
Now,
document.all
is not a standard API; this is legacy, non-standard one. Please see:
Document.
If you really need all elements of some tag name, all on the page (document), you can simply use
document.getElementsByTagName("div").length
:
Document.getElementsByTagName().
—SA