Concat two nodelists

前端 未结 4 1202
夕颜
夕颜 2021-02-04 02:17

I am trying to concat two nodelists using

var ul   = document.querySelector(\"ul\");
var down = document.getElementsByClassName(\"mobile\")[0];
var ul_child = Ar         


        
4条回答
  •  臣服心动
    2021-02-04 02:28

    This is a bit of a different approach, but perhaps you could try combining them in your query selector:

    var ul_down   = document.querySelectorAll("ul,.mobile:first-child");
    

提交回复
热议问题