var div = document.querySelectorAll("div"); console.log(Array.from(div));Array.from(div,function(item){ item.style.backgroundColor="red"; return item;});