Body bgColor property
Body objectDefinitions and usages
The bgColor property sets or returns the bgcolor property value of the body element. Ⅹ
The bgcolor property specifies the background color of the document.
Grammar
Set the bgColor property:
Return bgColor property:
value | describe |
---|---|
color | Specifies the background color.View full CSS color value |
Browser support
The bgColor property is supported by all major browsers
Returns the bgcolor property value of the body element:
<body id="w3s" bgcolor="#E6E6FA">
<script>
document.write("The background color is: ")
document.write(document.getElementById("w3s").bgColor);
</script>
</body>
</html>
Try it out . . .
Body object