Body bgColor attribute
Body object
Definition and Usage
The bgColor attribute sets or returns the value of the bgcolor attribute of the body element. x
The bgcolor attribute specifies the background color of the document.
Syntax
Set the bgColor attribute:
bodyObject.bgColor="
color
"
Return the bgColor attribute:
bodyObject.bgColor
| Value | Description |
|---|---|
| color | Specifies the background color. See the complete A CSS color value |
Browser support





All major browsers support the bgColor attribute
Example
Example
Return the value of the bgcolor attribute of the body element:
Try it »
Body object