THE WORLD'S LARGEST WEB DEVELOPER SITE

Style textDecorationColor Property

❮ Style Object

Example

Change the color of the line, in an underlined text:

document.getElementById("myP").style.textDecorationColor = "red";
Try it Yourself »

Definition and Usage

The textDecorationColor property specifies the color of the text-decoration (underlines, overlines, linethroughs).

Note: The textDecorationColor property will only have an effect on elements with a visible text-decoration.


Browser Support

Property
textDecorationColor Not supported Not supported Not supported
Use MozTextDecorationColor
Not supported Not supported

Syntax

Return the textDecorationColor property:

object.style.textDecorationColor

Set the textDecorationColor property:

object.style.textDecorationColor = "color|initial|inherit"

Property Values

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

Technical Details

Default Value: currentColor
Return Value: A String, representing the text-decoration-color property of an element
CSS Version CSS3

Related Pages

CSS reference: text-decoration-color property


❮ Style Object