Javascript Reference
Categories: TD

javascript TD bgColor

@March 15, 2008, 1:22 a.m.
bgColorFirefox/Netscape/NN 6 IE 4 Chrome/Safari/DOM 1  


Provides the background color of the table cell. This color setting is not reflected in the style sheet backgroundColor property. Even if the bgcolor attribute or bgColor property is set with a plain-language color name, the returned value is always a hexadecimal triplet.

document.getElementById("myTD").bgColor = "yellow";

A hexadecimal triplet or plain-language color name. See Appendix A for acceptable plain-language color names.


Varies with browser and operating system.

Powered by Linode.