Latest web development tutorials
 

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

Internet Explorer Firefox Opera Google Chrome Safari

The textDecorationColor property is not supported in any of the major browsers.

Firefox supports an alternative, the MozTextDecorationColor property.


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