Style textDecorationColor Property
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 | 57 | Not supported | 36.0 6.0 Moz |
7.1 Webkit | 44.0 |
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