YouTip LogoYouTip

Prop Style Textdecorationcolor

# Style textDecorationColor Property [![Image 8: Style Object Reference](#) 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 works on elements with a visible text-decoration. * * * ## Browser Support ![Image 9: Internet Explorer](#)![Image 10: Firefox](#)![Image 11: Opera](#)![Image 12: Google Chrome](#)![Image 13: Safari](#) Almost all major browsers do not support the textDecorationColor property. Firefox supports an alternative property for this, the MozTextDecorationColor property. * * * ## Syntax Get 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 Articles CSS Reference: (#) * * Style Object](#)
← Prop Style TextdecorationlineProp Style Textalignlast β†’