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
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";
}
0
thank you! it's working