Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to convert node list to array in javascript

// 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: #convert #node #list #array #javascript
ADD COMMENT
Topic
Name
1+1 =