Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
Address:<br>
<textarea id="myTextarea" maxlength="30">
342 Alvin Road
Ducksburg</textarea>
<p>Click the button to display the value of the maxlength attribute in the text area.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
  var x = document.getElementById("myTextarea").maxLength;
  document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>