0

How can I change color of the table?

I have a html table with a white custom color. Haw can I change it's color via JavaScript? thanks

25th Nov 2017, 10:38 AM
Kelion Noldo
2 Respostas
+ 1
Try this: function btnClick() { var x = document.getElementById("mytable").getElementsByTagName("td"); x[0].innerHTML = "i want to change my cell color"; x[0].style.backgroundColor = "yellow"; }
25th Nov 2017, 10:44 AM
LISANGOLA BONDJALI CHRISTIAN
LISANGOLA BONDJALI CHRISTIAN - avatar
0
thank you! it's working
25th Nov 2017, 10:49 AM
Kelion Noldo