Convert node list to a true array
You can use slice method to convert list of html nodes to a true array
var divTags = Array.prototype.slice.call(document.querySelectorAll("div"));
Great article about small and nifty js tips:
http://tech.pro/tutorial/1453/7-javascript-basics-many-developers-aren-t-using-properly?utm_source=javascriptweekly&utm_medium=email
Written by Timur Carpeev
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#