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

HTML DOM Style textDecorationColor Property

Style textDecorationColor Property

Style Object Reference The Style object

Example

Change the color of the underline in underlined text:

document.getElementById("myP").style.textDecorationColor="red";

Try it »


Definition and Usage

The textDecorationColor property specifies the color of the text decoration (underline, overline, line-through).

**Note:** The textDecorationColor property only takes effect on elements with a visible text-decoration.


Browser support

Internet Explorer Firefox Opera Google Chrome Safari

Almost all major browsers do not support the textDecorationColor property.

Firefox supports an alternative property, the MozTextDecorationColor property.


Syntax

Return the textDecorationColor property:

object

.style.textDecorationColor

Set the textDecorationColor property:

object

.style.textDecorationColor="

color

|initial|inherit"

Attribute values

Value Description
color Specifies the color of the text decoration.
initial Sets this property to its default value. See initial.
inherit Inherits this property from its parent element. See inherit.

Technical Details

Default value: currentColor
Return Value: A string representing the element's text-decoration-color property.
CSS version CSS3

Related Articles

CSS Reference Manual:text-decoration-color property


Style Object Reference The Style object