Style textDecorationStyleProperty
Examples
Display a wavy line below the paragraph:
document.getElementById("myP").style.textDecorationStyle="wavy";
Try it Yourself »
Definition and Usage
The textDecorationStyle property sets or returns how the line is displayed.
Browser Support
![]()
Almost all mainstream browsers do not support the textDecorationStyle property.
Firefox supports an alternative property, namely 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"
Property Values
| Value | Description |
|---|---|
| solid | Default. The line will be displayed as a single line. |
| double | The line will be displayed as a double line. |
| dotted | The line will be displayed as a dotted line. |
| dashed | The line will be displayed as a dashed line. |
| wavy | The line will be displayed as a wavy line. |
| initial | Sets the property to its default value. Seeinitial。 |
| inherit | Inherits this property from the parent element. Seeinherit。 |
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
Other Extensions
Style Object