Get elements just 1 level below the current element by javascript

后端 未结 8 2121
自闭症患者
自闭症患者 2021-02-05 20:30

I need to access the DOM tree and get the elements just 1 level below the current element.

Read the following code:

8条回答
  •  不要未来只要你来
    2021-02-05 21:19

    Try this (late answer, but can be useful for others):

    var list;
    list=document.getElementById("node").querySelectorAll("#node>div");
    

提交回复
热议问题