Código HTML:
<body> <script> function maximo(campo,limite){ if(campo.value.length>=limite){ campo.value=campo.value.substring(0,limite); } } </script> <textarea name="text" cols="56" rows="5" border:1px solid #333; onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';" onKeyDown="maximo(this,255);" onKeyUp="maximo(this,255);" readonly=”yes”>hola </textarea> </body> </html>