Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style textDecorationStyle Property

Style textDecorationStyle Property

Style Object Reference The Style object

Example

Display a wavy line below a paragraph:

document.getElementById("myP").style.textDecorationStyle="wavy";

Try it »


Definition and Usage

The textDecorationStyle property sets or returns how the line is displayed.


Browser support

Internet Explorer Firefox Opera Google Chrome Safari

Almost all major browsers do not support the textDecorationStyle property.

Firefox supports an alternative property, the MozTextDecorationStyle property.


Syntax

Return the textDecorationStyle property:

object

.style.textDecorationStyle

Set the textDecorationStyle property:

object

.style.textDecorationStyle="solid|double|dotted|dashed|wavy|initial|inherit"

Attribute values

Value Description
solid Default. The line is displayed as a single line.
double The line is displayed as a double line.
dotted The line is displayed as a dotted line.
dashed The line is displayed as a dashed line.
wavy The line is displayed as a wavy line.
initial Sets this property to its default value. See initial.
inherit Inherits this property from its parent element. See inherit.

Technical Details

Default value: solid
Return Value: A string representing the element's text-decoration-style property.
CSS version CSS3

Related Articles

CSS Reference Manual:text-decoration-style property


Style Object Reference The Style object