I am trying to concat two nodelists using
var ul = document.querySelector(\"ul\");
var down = document.getElementsByClassName(\"mobile\")[0];
var ul_child = Ar
You can try converting the two NodeList
objects to arrays first. Then calling concat
on the results:
// Convert the first list to an array
var ul_list = document.querySelector("ul"),
ul_children_array = Array.prototype.slice.call(ul_list.children);
// Convert the second list to an array
var down_list = document.getElementsByClassName("mobile")[0],
down_children_array = Array.prototype.slice.call(down_list.children);
var ul_child_array = Array.prototype.concat.call(ul_children_array, down_children_array);