JavaScript Tutorial/Document/fgColor — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 08:24, 26 мая 2010
document.fgColor
The fgColor property specifies the default text color.
This is equivalent to assigning the color to the text attribute in the <body> tag.
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 6 digits that follow the pattern "RRGGBB."
<HTML>
<head>
<title>this is a title</title>
</head>
<BODY bgcolor="beige" text= "black" link="darkblue" vlink="honeydew">
<SCRIPT language="JavaScript">
<!--
document.write("The text color is "+document.fgColor+"<BR>");
//-->
</SCRIPT>
</BODY>
</HTML>
Set the document.fgColor (IE)
<html>
<script language="JavaScript">
<!--
document.fgColor="0000ff";
-->
</script>
<body>
The color of all text on this page is blue.
</body>
</html>