Latest web development tutorials

HTML DOM Style textDecorationColor property

Style Object Reference Style Objects

Examples

Change the color of underlined text underlined:

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

try it"

Definition and Usage

textDecorationColor attribute specifies the text decoration (underline underline, overline overline, underlined line-through) color.

Note: Only the elements with the visible text-decoration, textDecorationColor property to work.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Almost all of the major browsers do not support textDecorationColor property.

Firefox supports another alternative of the property attribute that MozTextDecorationColor property.


grammar

Back textDecorationColor properties:

object .style.textDecorationColor

Setting textDecorationColor properties:

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

Property Value

描述
color 规定文本修饰的颜色。
initial 设置该属性为它的默认值。请参阅 initial
inherit 从父元素继承该属性。请参阅 inherit

technical details

Defaults: currentColor
return value: String representing the text-decoration-color attribute of the element.
CSS version CSS3


related articles

CSS Reference: text-Decoration-Color property


Style Object Reference Style Objects