getElementsByClassName returns [] instead of asynchronous appended node

后端 未结 6 1897
野性不改
野性不改 2020-12-17 05:40

(I ask my question again after the first one was terribly formulated)

I face the following problem:

6条回答
  •  半阙折子戏
    2020-12-17 06:30

    Please describe what you are doing with the returned results. There is a significant difference between a nodeList and a node, nodeLists are LIVE.

    So if you assign a nodeList returned by getElementsByClassName() (or similar) to a variable, this variable will change when you remove the nodes inside the nodeList from the DOM.

提交回复
热议问题