admin 管理员组文章数量: 1086019
In the MDN documentation, it says
The matching is done using depth-first pre-order traversal of the document's nodes starting with the first element in the document's markup and iterating through sequential nodes by order of the number of child nodes.
But I can't find any other information about this behavior on the Internet. And when asking ChatGPT, it says this wording must be an error.
I'm totally new to javascript and don't know who is right, but I do think an official reference such as the MDN can't be wrong, so can someone explains why it uses this specific order?
本文标签: javascriptquerySelector traversal by order of the number of child nodesStack Overflow
版权声明:本文标题:javascript - `querySelector` traversal by order of the number of child nodes? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1744071112a2528500.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论