您好我在这里有这段代码:
<script type="text/javascript"> function topic_e_s(str) {
if(str != "") {
str3 = str.replace(/^\s+|\s+$/g, '');
str3 = str3.replace(/\[b\]/g,' ').replace(/\[\/b\]/g,'')
str3 = str3.replace(/\[hide\](.+?)\[\/hide\]/g,'')
document.getElementById('topic_es').value = str3;
}}
</script>
<input type="text" name="subject_e" size="45"
maxlength="10" style="width:61%;" tabindex="2"
class="post" onFocus="Active(this)" onBlur="NotActive(this)"
value="{SUBJECT_E}" id="topic_es">
<textarea name="message" id="message" tabindex="3"
style="min-width:600px; min-height:300px;"
class="post" onFocus="Active(this)"
onBlur="NotActive(this); topic_e_s(this.value)"
onChange="topic_e_s(this.value)" onselect="storeCaret(this);"
onclick="storeCaret(this);"
onkeyup="storeCaret(this);">{MESSAGE}</textarea>
如何为输入添加textarea的字符限制?
我输入maxlength =&#34; 10&#34;但它没有帮助,并得到textarea的整个信息