Style textDecorationStyle Property
Example
Display a wavy line under the an element:
document.getElementById("demo").style.textDecorationStyle = "wavy";
Try it Yourself »
Definition and Usage
The textDecorationStyle property sets or returns how the line, if any, will display.
Browser Support
Property | |||||
---|---|---|---|---|---|
textDecorationStyle | 57.0 | 79.0 | 36.0 6.0 Moz |
12.1 | 44.0 |
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 value. The line will display as a single line |
double | The line will display as a double line |
dotted | The line will display as a dotted line |
dashed | The line will display as a dashed line |
wavy | The line will display as a wavy line |
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: | solid |
---|---|
Return Value: | A String, representing the text-decoration-style property of an element |
CSS Version | CSS3 |
Related Pages
CSS reference: text-decoration-style property
❮ Style Object