<script LANGUAGE="JavaScript">
function Check(txt)
{
TextCount=txt.value.length; //获取文本框的长度
div1.innerText=TextCount; //将长度显示在div中
}
</script>
</head>
<body>
<textarea type=text id=txt1 onkeyup="Check(this) " onKeyDown="Check(this)">
</textarea><br />当前字符数:<div id="div1"></div>
function Check(txt)
{
TextCount=txt.value.length; //获取文本框的长度
div1.innerText=TextCount; //将长度显示在div中
}
</script>
</head>
<body>
<textarea type=text id=txt1 onkeyup="Check(this) " onKeyDown="Check(this)">
</textarea><br />当前字符数:<div id="div1"></div>