Get Underline Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Underline


The Underline object represents an HTML <u> element.

You can access a <u> element by using getElementById():

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<u id="myU">this underlined text</u>

<button onclick="myFunction()">set the color</button>

function myFunction() {/*from  ww  w.  j  a  v  a  2 s.  c  o m*/
    var x = document.getElementById("myU"); = "red";


Related Tutorials