<!DOCTYPE html>
<html>
<head>
<style>
#myDIV {
text-decoration: underline;
}
</style>
</head>
<body>
<h1>Change text-decoration-line with JavaScript</h1>
<div id="myDIV">
Hello world!
</div>
<p>Click the "Try it" button to change the text-decoration-line of the div.</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
document.getElementById("myDIV").style.MozTextDecorationLine = "overline";
document.getElementById("myDIV").style.textDecorationLine = "overline";
}
</script>
<p><b>Note:</b> The textDecorationLine property is not supported in Edge prior 79.</p>
</body>
</html>