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.
Comments
Post a Comment