ho leto il tutorial sul innerHTML ma continuo a non capire dove sbaglio
questo codice mi restituisce sempre , qualsiasi voce io selezioni, tutte le celle insieme. perche?codice:<html><head> <script type="text/javascript"> function F1(a) { var elmCella1 = document.getElementById("cella1").innerHTML="pippo non è felice"; var elmCella2 = document.getElementById("cella2").innerHTML="pluto si"; var elmCella3 = document.getElementById("cella3").innerHTML="papperino si"; var elmCella4 = document.getElementById("cella4").innerHTML="e anche topolino"; } </script> </head> <body> <span style=''><b>Seleziona</b></span> <SELECT onChange="F1(this.value)"> <OPTION VALUE="cella1"> pippo</OPTION> <OPTION VALUE="cella2"> pluto</OPTION> <OPTION VALUE="cella3"> papperino</OPTION> <OPTION VALUE="cella4"> topolino</OPTION> </SELECT> <table border="1"> <tr> <td id='cella1'><td> <td id='cella2'><td> </tr> <tr> <td id='cella3'><td> <td id='cella4'><td> </tr> </table> </body> </html>

Rispondi quotando