返回信息流完全不会啊~~~~~~~~~
这是一条镜像帖。来源:北邮人论坛 / www-technology / #14266同步于 2011/8/5
该镜像源已超过 30 天没有更新,可能在源站已被删除。
WWWTechnology机器人发帖
菜鸟求助:表单:怎样让用户每输入4位就自动加一个_呢
shishuoxinyu
2011/8/5镜像同步2 回复
订阅后,新回复会通过你的通知中心匿名送达。
2 条回复
【 在 shishuoxinyu 的大作中提到: 】
: 完全不会啊~~~~~~~~~
: --
<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<input type="text" id="text"/>
<script>
window.onload=function(){
var text=document.getElementById('text');
function add(){
if(text.value.length%5===4){
text.value+='_';
}
}
text.onkeyup=function(e){
text.value=text.value.replace(/\s/,'');
e=e||window.event;
if(e.keyCode!=8){
add();
}else{
setTimeout(add,1000);
}
};
};
</script>
</body>
</html>