<script>
function textCounter(field,field2,maxlimit)
{
var countfield = document.getElementById(field2);
if( field.value.length > maxlimit )
{
field.value = field.value.substring( 0, maxlimit );
return false;
}
else
{
countfield.value = maxlimit - field.value.length;
}
}
</script>
<textarea onkeyup="textCounter(this,'counter',50);" id="message"></textarea>
<input disabled maxlength="3" size="3" value="50" id="counter">
在文本区域中输入数字或字符时,如何减少计数?