<html>
<head>
<title>动态统计输入字符的个数!</title>
<script language="javascript">
//统计字符数量
function countChars()
{
   var s = document.getElementById("description").value;
   if(!isMaxString(s,100))
   {
      document.getElementById("description").value = s.substring(0,100);
   }
   document.getElementById("count").value = document.getElementById("description").value.length+1;
}
//检测字符的数量
function isMaxString(inputString,count)
{
   if(inputString.length>count)
      return false;
   else
      return true;
}
</script>
</head>
<body>
<table>
<tr>
  <td width="250">请输入文字说明:</td>
  <td><input type="text" ></textarea></td>
</tr> 
</table>
</body>
</html>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-25
  • 2022-12-23
  • 2021-04-05
  • 2021-08-21
  • 2021-12-22
  • 2021-04-14
猜你喜欢
  • 2022-12-23
  • 2022-01-07
  • 2021-05-18
  • 2021-05-17
  • 2021-10-28
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案