Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>Change text-decoration with JavaScript</h1>
<p>Click the "Try it" button to underline the H1 element:</p>
<button onclick="myFunction()">Try it</button>
<h1 id="myH1">This is my header</h1>
<script>
function myFunction() {
  document.getElementById("myH1").style.textDecoration = "underline";
}
</script>
</body>
</html>