텍스트 장식의 색상을 설정하려면 textDecorationColor JavaScript의 속성
예시
다음 코드를 실행하여 텍스트 장식의 색상을 변경할 수 있습니다 -
<!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>