//限制用户输入最大字数为100 function limit(){ var max=100; var count=document.getElementById("textarea").value.length; if(count>max){ document.getElementById("textarea").value= document.getElementById("textarea").value.substr(0,max-1); } else{ document.getElementById("leave_amount").innerHTML=100-document.getElementById("textarea").value.length; } }
[code="java"] //限制用户输入最大字数为100function limit(){ var max=100; var count=document.getElementById("textarea").value.length; if(count>max){ document.getElementById("textarea").value= ...