html:textarea html:text中有maxlength属性 字段长度超过maxlength时 键盘输入无效在html:textarea中如何实现这样的功能 即超过一定长度时 键盘输入无效!请高手帮忙 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 比如输入长度不超过200<textarea rows="5" cols="50" onKeyUp="if(this.value.length > 200){this.value=this.value.substr(0,200);}"></textarea> <html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>test</title><script>function key_down(obj,e){if(window.event) e = window.event;if(obj.value.length>=200){e.keyCode=0;e.returnValue=false; }}</script></head><body><textarea rows="5" cols="50" onkeydown="key_down(this,event)"></textarea></body></html> IE里可用<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>test</title><script>function pro_change(obj){if(obj.value.length>200){obj.value = obj.value.substr(0,200);}}</script></head><body><textarea rows="5" cols="50" onpropertychange="pro_change(this)"></textarea></body></html> 求各位大侠 发个用JS写的注册信息时的验证码 请教prototype.js的问题 document.getElementById()在IE提示缺少对象 在firefox正常 htc的问题 输入的数字范围判断 想把js中的url传递到jsp本页 非常弱智的问题,烦劳大侠里面请,在线等候,立刻结帖 有关取字符的问题? 那里有好的HTML,JavaScript的学习资料呀 如何在页面中响应<回车>??? 兼容问题 怎样在框架链接里实现按当前日期自动改写链接地址
<textarea rows="5" cols="50" onKeyUp="if(this.value.length > 200){this.value=this.value.substr(0,200);}"></textarea>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>test</title>
<script>
function key_down(obj,e){
if(window.event) e = window.event;
if(obj.value.length>=200){
e.keyCode=0;
e.returnValue=false;
}
}
</script>
</head><body>
<textarea rows="5" cols="50" onkeydown="key_down(this,event)"></textarea>
</body></html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>test</title>
<script>
function pro_change(obj){
if(obj.value.length>200){
obj.value = obj.value.substr(0,200);
}
}
</script>
</head><body>
<textarea rows="5" cols="50" onpropertychange="pro_change(this)"></textarea>
</body></html>