Salve stavo consultando la guida DOM presente nel sito e ho traovato il seguente codice:
-------------------------------------------------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Pagina senza titolo</title>
<script language="javascript" type="text/javascript">
colore = new Array("red","orange","green");
function colore_celle() {
if(document.getElementById && document.getElementsByTagName) {
celle = document.getElementById("r3").getElementsByTagName ("td");
for(i=0; i < celle.length; i++)
celle[i].style.color = colore[i];
}
}
</script>
</head>
<body>
<table border="1" id="tabella1">
<tr>
<td>cella 0</td>
<td>cella 1</td>
<td>cella 2</td>
</tr>
<tr id="r3">
<td id="c3">cella 3</td>
<td>cella 4</td>
<td>cella 5</td>
</tr>
</table>
<input id="button1" type="button" value="CambiaColore" onclick="colore_celle()" />
</body>
------------------------------------------------------------------------------
Come potete constatare il codice è molto semplice e serve a cambiare colore nelle celle dell'ultima riga della tabella. Adesso avevo questo obiettivo: realizzare un programma che chieda un valore che serva a individuare qualunque riga e cambiarla successivamente di colore. Come dovrebbe cambiare il codice?