Textarea readOnly Property - Find out if a text area is read-only or not: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Textarea

Description

Textarea readOnly Property - Find out if a text area is read-only or not:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>
Address:<br>
<textarea id="myTextarea">
Main Street//ww  w .ja v  a  2  s  .  c  om
New York</textarea>

<button type="button" onclick="myFunction()">Test</button>

<script>
function myFunction() {
    var v = document.getElementById("myTextarea").readOnly;
    console.log(v);
}
</script>

</body>
</html>

Related Tutorials