Edit This Code:
See Result »
<!DOCTYPE html> <html> <head> <style> p#myP { text-decoration: underline; } </style> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "//hm.baidu.com/hm.js?73c27e26f610eb3c9f3feb0c75b03925"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> </head> <body> <p id="myP"> Hello world! </p> <p>Click the "Try it" button to change the text-decoration-line of the paragraph.</p> <button onclick="myFunction()">Try it</button> <script> function myFunction() { document.getElementById("myP").style.MozTextDecorationLine = "overline"; // Code for Firefox document.getElementById("myP").style.textDecorationLine = "overline"; } </script> <p><b>Note:</b> The textDecorationLine property is not supported in any of the major browsers.</p> <p><b>Note:</b> Firefox supports an alternative, the MozTextDecorationLine property.</p> </body> </html>
Result: