Body textProperty

Body 对象对象参考手册Body Object

Definition and Usage

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

The text property describes the text color of the document.

Syntax

Set the text property:

bodyObject.text="color"

Return the text property:

bodyObject.text

Value Description
color Specifies the text color. See the completeCSS color values


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the text property.


Example

Example

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

<html>
<body id="w3s" text="#0000FF">

<script>
document.write("The text color is: ")
document.write(document.getElementById("w3s").text);
</script>

</body>
</html>

Try it yourself »


Body 对象参考手册Body Object Other Extensions