I tried limiting the user input but it wasn't successful, please guide me where I am making mistake.
JS
<script type="text/javascript"> function countLength() { var maxLength=10; var length = document.getElementById("txt").value.length; if(length>10) { return false; } } </script> HTML code
<form name="formA" id="formA" action="#" > <textarea id="txt" name="txt" onkeyup="countLength()"></textarea> </form>