

- 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 type of line in a text-decoration with JavaScript?
To set the type of line in text-decoration, use the textDecorationLine property. You can try to run the following code to return the type of line in a text-decoration with JavaScript −
Example
<!DOCTYPE html> <html> <body> <div id = "myText" style = "text-decoration: underline;"> This is demo text. </div> <br> <button onclick="display()"> Set Text Decoration </button> <script> function display() { document.getElementById("myText").style.textDecorationColor = "red"; document.getElementById("myText").style.textDecorationLine = "overline"; } </script> </body> </html>
- Related Questions & Answers
- How to set the style of the line in a text decoration with JavaScript?
- How to set the decoration of a text with JavaScript?
- How to set the color of the text-decoration with JavaScript?
- How to set the indentation of the first line of text with JavaScript?
- Set the color of the text decoration in CSS
- Set the style of the text decoration in CSS
- Set the height of a line of text with CSS
- Set the kind of decoration used on text in CSS
- How to set the capitalization of a text with JavaScript?
- How to set the shadow effect of a text with JavaScript?
- How to set the text direction with JavaScript?
- How to set the font size of text with JavaScript?
- How to set the horizontal alignment of text with JavaScript?
- How to change the 'text-decoration' property with jQuery?
- Text Decoration in CSS
Advertisements