

- 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
HTML DOM Underline Object
The HTML DOM Underline Object in HTML represents the <u> element.
Creating a <u> element
var uObject = document.createElement(“U”)
Let us see an example of Underline element −
Example
<!DOCTYPE html> <html> <head> <title>HTML DOM Underline</title> <style> form { width:70%; margin: 0 auto; text-align: center; } * { padding: 2px; margin:5px; } input[type="button"] { border-radius: 10px; } </style> </head> <body> <form> <fieldset> <legend>HTML-DOM-Underline</legend> <h2 ><u id="Underline">Warning: </u>This is a Demo Example</h2> <input type="button" value="Show" onclick="getBetterDisp()"> </fieldset> </form> <script> var uObject = document.getElementById("Underline"); function getBetterDisp() { uObject.style.backgroundColor = '#DC3545'; uObject.style.color = '#FFF'; } </script> </body> </html>
Output
Before clicking show button −
After clicking show button −
- Related Questions & Answers
- HTML DOM Object Object
- HTML DOM HTML Object
- HTML DOM Abbreviation Object
- HTML DOM Address Object
- HTML DOM Select Object
- HTML DOM iFrame Object
- HTML DOM Image Object
- HTML DOM Option Object
- HTML DOM Progress Object
- HTML DOM Quote Object
- HTML DOM Samp Object
- HTML DOM Section Object
- HTML DOM Script Object
- HTML DOM Parameter Object
- HTML DOM PopStateEvent Object
Advertisements