javascript - Does getElementsByClassName keep ordering? -


the webpage working contains alphabetically sorted list of div's have same class. if call document.getelementsbyclassname('classname'), can sure array returns sorted in html order?

yes.

the collection represents view of subtree rooted @ collection’s root, containing nodes match given filter. view linear. in absence of specific requirements contrary, the nodes within collection must sorted in tree order.

https://dom.spec.whatwg.org/#old-style-collections


Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -