Javascript examples for DOM HTML Element:Underline
The Underline object represents an HTML <u> element.
You can access a <u> element by using getElementById():
<!DOCTYPE html> <html> <body> <u id="myU">this underlined text</u> <button onclick="myFunction()">set the color</button> <script> function myFunction() {/*from ww w. j a v a 2 s. c o m*/ var x = document.getElementById("myU"); x.style.color = "red"; } </script> </body> </html>