<style type="text/css">
<!--
input {renaksi:expression(onkeyup=function(){value=value.replace(/[^\\d]/g,'')})}
-->
</style>
</head><body>
<input name="" type="text">
</body>记得转义符号\
<!--
input {renaksi:expression(onkeyup=function(){value=value.replace(/[^\\d]/g,'')})}
-->
</style>
</head><body>
<input name="" type="text">
</body>记得转义符号\
解决方案 »
- 请教:IE8升级后造成网站部分内容不显示的解决办法
- 准备学习prototype.js,帮助文档中有这么多列表,到底先学哪个啊?看进来看图!
- WdatePicker.js在ie9无法打开
- 能不能在一个页面放一段javascript语句,页面一加载就发送一个请求到服务器了,获取页面的内容
- 怎么实现在下面这网页上面插入一个DIV实现多行逐字显示(下面是代码)
- 当代码里有多个引号时怎么解决?
- [求救]关于ActiveX控件的方法和函数的
- 进来看看吧。
- 这个问题谁会?
- 请教各位,可不可以限制一次只能选中5个checkbox??
- 急问!
- 页面由两个iframe分成两半,怎么在两个iframe间加上线,其可拖动来动态调整两iframe宽度?
<input onkeyup="value=value.replace(/[^\d]/g,'')">我用这个,为什么就不需要\转义啊?同样的啊?
这个也不行,从语法上好像找不到错误。
<style type="text/css">
<!--
input {renaksi:expression(onkeyup=a())}
-->
</style>
</head><body>
<script>function a(){event.srcElement.value=event.srcElement.value.replace(/[^\d]/g,'')}</script>
<input name="" type="text">
<script language=javascript>
function is_n()
{
event.srcElement.value = event.srcElement.value.replace(/[^\d]/g,""));
}
</script>PS:这样是可以的
我怎么运气没那么好啊,没有误打误撞加了转义符号
^o^ ^0^
<!--
input {renaksi:expression(onkeyup=a)}
-->
</style>
</head><body>
<script>function a(){event.srcElement.value=event.srcElement.value.replace(/[^\d]/g,'')}</script>
<input name="" type="text">调用时候不要括号()