Edit This Code:
<!DOCTYPE html>
<html>
<body>

<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>


Result:
Try it Yourself - © w3schools.com
Privacy Policy