Textarea disabled Property - Find out if a text area is disabled, or not: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Textarea

Description

Textarea disabled Property - Find out if a text area is disabled, or not:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>
Address:<br>
<textarea id="myTextarea">
Main Street/*  w ww  . j  a  v  a2 s  .c o  m*/
New York</textarea>
<br>

<button onclick="disableTxt()">Disable text area</button>
<button onclick="enableTxt()">Enable text area</button>

<script>
function disableTxt() {
    document.getElementById("myTextarea").disabled = true;
    var v = document.getElementById("myTextarea").disabled;
    console.log(v);
}
function enableTxt() {
    document.getElementById("myTextarea").disabled = false;
    var v = document.getElementById("myTextarea").disabled;
    console.log(v);
}
</script>

</body>
</html>

Related Tutorials