【Código HTML】
<table> <tr> <td> SMS Content: </td> <td> <textarea name = "message" cols = "96" lobos = "5" onkeydown = "textcounter (mensagem, remlen, 65); name = "Remlen" type = "text" value = "65" size = "5" readonly = "readonly"> caracteres, e o número máximo de caracteres permitidos para cada mensagem de texto é <strong> 65 </strong> caracteres </td> </tr> </tabela>
【Código JS relevante】
<Cript> função textCounter (campo, Countfield, maxlimit) {if (field.value.length> maxlimit) field.value = field.value.substring (0, maxlimit); elSecountfield.value = maxlimit - campo.value.length;} </script>