text property (body)
Specifies or returns the color of the text in the document body.
This property is deprecated. Use the color style property of the body element instead.
Syntax:
You can find the related objects in the Supported by objects section below.
This property is read/write.
HTML page for this property: text |
Possible values:
A legal color value. It can be a hexadecimal, RGB or predefined color value. For more information, see the page for colors.
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the text attribute:
|
||||
<body text="red"> The color of the text is red. </body> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 2:
Recommendation:
|
||||
<body style="color:#FF0000;"> The color of the text is red. </body> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 3:
This example illustrates the use of the text property:
|
||||
<head> <script type="text/javascript"> function ChangeTextColor () { document.body.text = "blue"; } </script> </head> <body text="red"> The color of the text is red.<br /> <button onclick="ChangeTextColor ()">Change text color</button> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
HTML elements:
Related pages:
External links:
User Contributed Comments