HTML DOM Textarea disabled 속성은 HTML 문서의 텍스트 영역 요소가 비활성화되었는지 여부를 반환하고 수정합니다.
구문
다음은 구문입니다 -
1. 사용 중지됨
object.disabled
2. 비활성화된 추가
object.disabled = true | false
HTML DOM Textarea disabled 속성의 예를 살펴보겠습니다.
예시
<!DOCTYPE html>
<html>
<style>
body {
color: #000;
background: lightseagreen;
height: 100vh;
}
.btn {
background: #db133a;
border: none;
height: 2rem;
border-radius: 2px;
width: 40%;
display: block;
color: #fff;
outline: none;
cursor: pointer;
}
</style>
<body>
<h1>DOM Textarea disabled Property Demo</h1>
<textarea placeholder="Hi! I'm placeholder text of a textarea element" rows="8" cols='20'></textarea>
<button onclick="set()" class="btn">Disable Textarea</button>
<script>
function set() {
document.querySelector("textarea").disabled = true;
}
</script>
</body>
</html> 출력

"텍스트 영역 비활성화를 클릭합니다. " 버튼을 눌러 텍스트 영역 요소를 비활성화합니다.
