Autor Zpráva
celda
Profil *
Jeste zde mam tento dotaz.
Mam html dokument a v nem
<table>
<tr>
<td id="x">obsah
</td>
</tr>
</table>

a potrebuju zmenit barvu pozadi te bunky

document.getElementById('x').style.background-color = '#ff0000';
ani
document.getElementById('x').style.background-color = 'red';
nefunguje
centi
Profil
Dvojslovné CSS definície sa v Javascripte nepíšu s pomlčkou, ale druhé slovo začína veľkým písmenom:

document.getElementById('x').style.backgroundColor = '#ff0000';
celda
Profil *
diky
Toto téma je uzamčeno. Odpověď nelze zaslat.

0