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++ - Qt setGeometry: Unable to set geometry -

python - argument must be rect style object - Pygame -

How to resolve Delphi error: Incompatible types: 'PWideChar' and 'Pointer' -