टेक्स्ट-डेकोरेशन में लाइन के प्रकार को सेट करने के लिए, textDecorationLine का उपयोग करें संपत्ति। जावास्क्रिप्ट के साथ टेक्स्ट-डेकोरेशन में लाइन के प्रकार को वापस करने के लिए आप निम्न कोड को चलाने का प्रयास कर सकते हैं -
उदाहरण
<!DOCTYPE html>
<html>
<body>
<div id = "myText" style = "text-decoration: underline;">
This is demo text.
</div>
<br>
<button onclick="display()"> Set Text Decoration </button>
<script>
function display() {
document.getElementById("myText").style.textDecorationColor = "red";
document.getElementById("myText").style.textDecorationLine = "overline";
}
</script>
</body>
</html>