Ciao,
ho abbozzato questo codice ma sicuramente qualcuno più esperto potrà fornirti una soluzione migliore:
Saluti.codice:<html> <head> <script type="text/javascript"> var selected = 0; function selectLine(x) { var currRow = document.getElementById("row"+x); if (selected != 0) { var selectedRow = document.getElementById("row"+selected); selectedRow.style.backgroundColor='#ffffff'; } currRow.style.backgroundColor='#cccccc'; selected = x; } </script> </head> <body> <table border="1"> <tr id="row1"> <td>1</td><td>2</td><td><input type="radio" id="1" name="send" value="Invia" onclick="selectLine(this.id);" /></td> </tr> <tr id="row2"> <td>4</td><td>5</td><td><input type="radio" id="2" name="send" value="Invia" onclick="selectLine(this.id);" /></td> </tr> <tr id="row3"> <td>7</td><td>8</td><td><input type="radio" id="3" name="send" value="Invia" onclick="selectLine(this.id);" /></td> </tr> </table> </body> </html>

Rispondi quotando