var elements = document.querySelectorAll('div'); for ( i = 0; i < elements.length; i++) { elements[i].className }