Javascript Style How to - Set text decoration








Question

We would like to know how to set text decoration.

Answer


<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'>
window.onload=function(){<!--from  w w w .j  a  va 2 s . c o  m-->
var a = document.getElementById("link");
    a.style.color = "#0000FF";
    a.style.textDecoration = "none";
}
</script>
</head>
<body>
  <a id="link" href="#">Test link</a>
</body>
</html>

The code above is rendered as follows: