Style textDecorationStyle attribute

Definition and usage

textDecorationStyle Attribute sets or returns the display method of the line (if any).

See also:

CSS Reference Manual:text-decoration-style attribute

Example

Display a wavy line below the paragraph:

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

Try it yourself

Syntax

Return textDecorationStyle attribute:

object.style.textDecorationStyle

Set textDecorationStyle attribute:

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

Attribute value

Value Description
solid Default value. The line is displayed as a single line.
double The line will be displayed as a double line.
dotted The line will be displayed as a dashed line.
dashed The line will be displayed as a dashed line.
wavy The line will be displayed as a wavy line.
initial Set this attribute to its default value. See initial.
inherit This attribute is inherited from its parent element. See inherit.

Technical details

Default value: solid
Return value: A string that represents the element's text-decoration-style attribute.
CSS version: CSS3

Browser support

Table numbers indicate the first browser version that fully supports this attribute.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
57.0 79.0 36.0 12.1 44.0