document.bgColor : bgColor « Document « JavaScript Tutorial






Syntax

document.bgColor

The bgColor property specifies the background color of HTML document.

The color is expressed as a string in hexadecimal digits or as one of the JavaScript standard color names.

The hexadecimal form is made up of six digits that follow the pattern "RRGGBB."

The color of the background can also be set with bgcolor attribute of the tag.

<HTML>
<head>
<title>this is a title</title>
</head>
<BODY bgcolor="beige" text= "black" link="darkblue" vlink="honeydew">

<SCRIPT language="JavaScript">
<!--

document.write("The background color is "+document.bgColor+"<BR>");

//-->
</SCRIPT>

</BODY>

</HTML>








14.6.bgColor
14.6.1.document.bgColor
14.6.2.Change the document.bgColor