Does jQuery always iterate through DOMs in order in which they are found in the code?

前端 未结 3 689
囚心锁ツ
囚心锁ツ 2021-02-19 12:58

Say, for example, I have a sortable list:

  • Item 1
  • Item 2
  • Item 3
3条回答
  •  花落未央
    2021-02-19 14:00

    It didn't use to, but since jQuery 1.3.2 selectors return elements in the order in which they are found in the DOM.

提交回复
热议问题