[].forEach.call(document.getElementsByTagName("img"), function(img) { img.className = img.alt; });