Javascript examples for CSS Style Property:textDecorationStyle
The textDecorationStyle property sets or gets the style for text decoration line.
Value | Description |
---|---|
solid | Default value. The line will display as a single line |
double | a double line |
dotted | a dotted line |
dashed | a dashed line |
wavy | a wavy line |
initial | Sets this property to its default value. |
inherit | Inherits this property from its parent element. |
Item | Value |
---|---|
Default Value: | solid |
Return Value: | A String, representing the text-decoration-style property of an element |
CSS Version | CSS3 |
Display a wavy line under the paragraph:
<!DOCTYPE html> <html> <head> <style> p#myP {//www .ja va2s.co m text-decoration: underline; } </style> </head> <body> <p id="myP"> Hello world! </p> <button onclick="myFunction()">Test</button> <script> function myFunction() { document.getElementById("myP").style.MozTextDecorationStyle = "dotted"; // Code for Firefox document.getElementById("myP").style.textDecorationStyle = "dotted"; } </script> </body> </html>