以字元數控制: 複製程式碼複製程式碼 複製程式碼 複製程式碼複製程式碼🎜> .substr(0,2000)" onkeydown="if(this.value.length>2000) this.value=this.value.substr(0,20000)"2000) this.value=this.value.substr(0,2000)" onpropertychange= "if(this.value.length>2000) 0.value=0. ">以位元組數控制: 複製程式碼 代碼如下: . "key1=this.value;value1 = key1.replace(/[u4e00-u9fa5]/g,' ');if(value1.length>500) this.value=this.value.substr(0,500)" onkeyup="key1=this.value;value1 = key1.replace(/[u4e00-u9fa5]/g,' ');if(value1.length>500) this.value=this.value.substr(0,500)" onblur="key1=this.value;value1 = key1.replace(/[u4e00-u9fa5]/g,' ');if(value1.length>500) this.value=this.value.substr(0,5000) " onchange="key1=this.value;value1 = key1.replace(/[u4e00-u9fa5]/g,' ');if(value1.length>500) this.value=this.value.substr(value1.length>500) this.value=this.value.substr(value1. 0,500)">