Javascript examples for DOM HTML Element:Textarea
Textarea maxLength Property - Change the maximum number of characters allowed in a text area:
<!DOCTYPE html> <html> <body> Address:<br> <textarea id="myTextarea"> </textarea> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*from w ww. ja v a2 s . c o m*/ document.getElementById("myTextarea").maxLength = "4"; document.getElementById("demo").innerHTML = "Maximum number of characters allowed in the text area is now 4."; } </script> </body> </html>