Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Body text attribute

Body text attribute

Body Object Reference Body object


Definition and Usage

The text attribute sets or returns the value of the text attribute of the body element.

The text attribute describes the text color of the document.

Syntax

Set the text attribute:

bodyObject.text="

color

"

Return the text attribute:

bodyObject.text

Value Description
color Specifies the text color. See the complete A CSS color value

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the text attribute.


Example

Example

Return the value of the text attribute of the body element:

Try it »


Body Object Reference Body object