
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to set the color of the text-decoration with JavaScript?
To set the color of the text-decoration, use the textDecorationColor property in JavaScript.
Example
You can try to run the following code to change the color of the text-decoration −
<!DOCTYPE html> <html> <body> <div id = "myText"> This is demo text. </div> <br> <button onclick = "display()"> Set Text Decoration </button> <script> function display() { document.getElementById("myText").style.textDecoration = "underline"; document.getElementById("myText").style.textDecorationColor = "red"; } </script> </body> </html>
- Related Questions & Answers
- Set the color of the text decoration in CSS
- How to set the decoration of a text with JavaScript?
- How to set the style of the line in a text decoration with JavaScript?
- How to set the type of line in a text-decoration with JavaScript?
- Set the style of the text decoration in CSS
- How to set the color of a text with CSS
- How to return the color of the text with JavaScript?
- Animate CSS text-decoration-color property
- How to Change Link Underline Color using text-decoration-color CSS
- Set the kind of decoration used on text in CSS
- How to set the color of the left border with JavaScript?
- How to set the color of the right border with JavaScript?
- How to set the color of the top border with JavaScript?
- How to set the text direction with JavaScript?
- How to set the color of the rule between columns with JavaScript?
Advertisements