标签:
<span style="font-size:18px;"><script language="javascript">
function countChar(textareaName,spanName)
{
document.getElementById(spanName).innerHTML = 140 - document.getElementById(textareaName).value.length;
}
</script>
可以输入<span id="counter">140</span>字<br/>
<textarea id="status" name="status" rows="6" cols="40" onkeydown=‘countChar("status","counter");‘
onkeyup=‘countChar("status","counter");‘></textarea></span>
http://www.jb51.net/article/50887.htm
JavaScript中统计Textarea字数并提示还能输入的字符
标签:
原文地址:http://www.cnblogs.com/seasonzone/p/4981496.html