js代码:
function checkLen(){
alert(document.getElementById("summary").value.length);
var len=500;
var s=document.getElementById("summary").value.length;
if(s > len){
alert("字数已经超过500");
}
}
HTML代码:
<html:textarea property="summary" title="不能为空" rows="10" cols="80"
minlength="1" onlyClass="required" οnchange="checkLen();"/>