Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js convert nodelist to array

// Get all buttons as a NodeList
var btns = document.querySelectorAll('button');

// Convert buttons NodeList to an array
var btnsArr = Array.from(btns);
Source by gomakethings.com #
 
PREVIOUS NEXT
Tagged: #js #convert #nodelist #array
ADD COMMENT
Topic
Name
8+4 =