probabilmente stai facendo un errore da qualche altre parte
se provo il codice su un esempio come il seguente a me funziona correttamente
codice:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="it" xml:lang="it">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>xhtml 1.0</title>
</head>
<script type="text/javascript">
// <![CDATA[
function aumenta() {
var lista_div = document.getElementsByTagName("div");
for(i=0; i < lista_div.length; i++) {
if(lista_div[i].className == "xyz") {
lista_div[i].style.fontSize = "50px";
lista_div[i].style.color = "#FF0000";
}
}
}
// ]]>
</script>
<body onload="aumenta()">
<div class="xyz">xyz</div>
<div class="abc">1</div>
<div class="xfr">2</div>
<div class="xyz">xyz</div>
<div class="xab">3</div>
<body>
</html>