[Chapter 21] Reference: Document.fgColor
Author: David Flanagan
Date: Fri Aug 29 11:15:06 1997

#

| Chapter 21 JavaScript Reference |

# Document.fgColor Property

## Name

Document.fgColor Property---the default text color

## Availability

Navigator 2.0, Internet Explorer 3.0

## Synopsis

    document.fgColor

## Description

`fgColor` is a string property that specifies the default color of text in `document`. This default color is used for all text in the document except hypertext links and text with an alternate color specified through the `COLOR` attribute of the HTML `<FONT>` tag.

The document text color can be set through the `TEXT` attribute in the `<BODY>` HTML tag, and the `fgColor` property will contain the specified value. The default color may also be specified by assigning a value to `fgColor` directly, but this may only be done in the `<HEAD>` of the document, before the `<BODY>` tag is parsed.

Colors are specified either as one of the standard color names recognized by JavaScript, or as red, green, and blue color values, expressed as a string of six hexadecimal digits in the form `"``RRGGBB``"`.

## See Also

"Document", "Document.alinkColor", "Document.bgColor", "Document.linkColor", "Document.vlinkColor", Appendix G, JavaScript and HTML Color Names and Values

Document.embeds[] |  | Document.forms[]