0 out of 1 rated this helpful - Rate this topic

text attribute | text property

Sets or gets the text (foreground) color for the document body.

Syntax

HTML<element text="p" ... >
JavaScript

p = object.text

Property values

Type: Variant

any of the color names or values in the Color Table.

Standards information

Remarks

Some browsers do not recognize color names, but all browsers should recognize RGB color values and display them correctly.

Examples

This example uses the text property to change the text color of the body.

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/text.htm


<body id="oBody">
: 
<button onmouseover="oBody.text='green'">GREEN</button>
<button onmouseover="oBody.text='red'">RED</button>
<button onmouseover="oBody.text='blue'">BLUE</button>

</body>


See also

body

 

 

Send comments about this topic to Microsoft

Build date: 11/28/2012

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.