Answers for "array to nodelist"

2

nodelist to array

Array.from(nodelist);
Posted by: Guest on July-22-2020
0

js array to nodelist

var toNodeList = function(arrayOfNodes){
  var fragment = document.createDocumentFragment();
  arrayOfNodes.forEach(function(item){
    fragment.appendChild(item.cloneNode());
  });
  return fragment.childNodes;
};
Posted by: Guest on August-26-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language