links = document.getElementsByTagName("a"); for (i = 0; i < links.length; i++) { if (links[i].className == "other") { alert(links[i].style.background); } }
var links = document.links, i; for(i = 0; i < links.length; i++) { if(links[i].className == "other") { alert(getComputedStyle(links[i], '').background); } }