Body text property
Body objectDefinitions and usages
The text property can set or return the text property value of the body element.
The text property describes the text color of the document.
Grammar
Set the text property:
Return text property:
value | describe |
---|---|
color | Specifies the text color.View full CSS color value |
Browser support
Text properties are supported by all major browsers.
Returns the text property value of the body element:
<body id="w3s" text="#0000FF">
<script>
document.write("The text color is: ")
document.write(document.getElementById("w3s").text);
</script>
</body>
</html>
Try it out . . .
Body object