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