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

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

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