Javascript examples for CSS Style Property:textDecorationColor
The textDecorationColor property sets the color of the text-decoration.
Value | Description |
---|---|
color | Sets the color of the text-decoration |
initial | Sets this property to its default value. |
inherit | Inherits this property from its parent element. |
Item | Value |
---|---|
Default Value: | currentColor |
Return Value: | A String, representing the text-decoration-color property of an element |
CSS Version | CSS3 |
Change the color of the line, in an underlined text:
<!DOCTYPE html> <html> <head> <style> p#myP {/*from w w w .jav a 2s . c o 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.MozTextDecorationColor = "red"; // Code for Firefox document.getElementById("myP").style.textDecorationColor = "red"; } </script> </body> </html>