<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"; // Code for Firefox
document.getElementById("myDIV").style.textDecorationLine = "overline";
}
</script>
<p><b>Note:</b> The textDecorationLine property is not supported in Edge.</p>
</body>
<!-- Mirrored from www.w3schools.com/cssref/tryit.asp?filename=trycss3_js_text-decoration-line by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:01:24 GMT -->
</html>