--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<textarea name="teraContent" id="teraContent" runat="server" rows="10" wrap="PHYSICAL" cols="75" onkeydown ="CheckWorkCount(this.form.teraContent,this.form.remain);" onKeyUp="CheckWorkCount(this.form.teraContent,this.form.remain);"></textarea>
您还可以输入:<input disabled maxLength="4" style="border:none; background-color:none;" name="remain" size="3" value="10" class="inputtext">/200个字</td></tr>
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function CheckWorkCount(message, remain)
{
var max;
max = 200;
if (message.value.length > max) {
message.value = message.value.substring(0,max);
remain.value = 0;
alert("不能超过"+200+"个字!");
}
else {
remain.value = max - message.value.length;
}
}