<html>
<head>
<title>JS限制Textarea文本域字符個數</title>
<meta http
<SCRIPT LANGUAGE="JavaScript">
<!
function textCounter(field
// 函數
if (field
//如果元素區字符數大於最大字符數
field
else
//在記數區文本框內顯示剩余的字符數
countfield
}
//
</SCRIPT>
</head>
<body>
<form name=myform action="">
<textarea name="message" cols="
您還可以輸入:<input name="remLen" type="text" value="
</form>
</body>
</html>
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/19897.html