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