HTML DOM Textarea अक्षम संपत्ति लौटाती है और संशोधित करती है कि HTML दस्तावेज़ में टेक्स्ट क्षेत्र तत्व अक्षम है या नहीं।
सिंटैक्स
निम्नलिखित वाक्य रचना है -
<मजबूत>1. वापसी अक्षम
object.disabled
<मजबूत>2. अक्षम जोड़ा जा रहा है
object.disabled = true | false
आइए HTML DOM Textarea अक्षम संपत्ति का एक उदाहरण देखें:
उदाहरण
<!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> आउटपुट

“पाठ क्षेत्र अक्षम करें . पर क्लिक करें टेक्स्टरी तत्व को अक्षम करने के लिए बटन।
