![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
perchè per cambiare lo sfondo a una cella questo nn funziona si deve usare cella.setAttribute('bgcolor','#406f9d'); mentre questo[ cella.setAttribute('bgcolor','#406f9d'); ] funziona solo su Mozilla 1.0 e non su IE6 Grazie script type="text/javascript" function colore_sfondo_celle(){ if(document.getElementById){ cella=document.getElementById("c5"); alert(cella.getAttribute("id")); //cella.setAttribute('bgcolor','#406f9d'); cella.style.background='#406f9d'; alert('ci arrivo'); }else{ alert('il tuo browser non supporta questa proprietà del DOM W3C'); } } /script /head body table border="1" tr td>cella 0</td td>cella 1</td td>cella 2</td /tr tr ID="r3" td bgcolor="#999999" ID="c3">cella 3</td td>cella 4</td td ID="c5" width="300">cella 5</td /tr tr td input type="button" onClick="colore_sfondo_celle();" value="prova" /td /tr /table |
![]() |
| Thread Tools | |
| Display Modes | |
| |