标签:code status asc function size inner nbsp counter lang
<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>
JavaScript中统计Textarea字数并提示还能输入的字符
标签:code status asc function size inner nbsp counter lang
原文地址:http://www.cnblogs.com/daba/p/6978085.html