<html>
<body>
Address:<br>
<textarea id="myTextarea">
</textarea>
<p>Click the button to set the maximum number of characters allowed in the text area to "4".</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
document.getElementById("myTextarea").maxLength = "4";
document.getElementById("demo").innerHTML = "Maximum number of characters allowed in the text area is now 4.";
}
</script>
</body>
</html>