<style type="text/css">
<!--
input {renaksi:expression(onkeyup=function(){value=value.replace(/[^\\d]/g,'')})}
-->
</style>
</head><body>
<input name="" type="text">
</body>记得转义符号\

解决方案 »

  1.   

    不好意思,有个问题要请教。
    <input onkeyup="value=value.replace(/[^\d]/g,'')">我用这个,为什么就不需要\转义啊?同样的啊?
      

  2.   

    寒~~~~~~~~~~~~
    这个也不行,从语法上好像找不到错误。
    <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">
      

  3.   

    <input type=eidt onkeyup=a()>
    <script language=javascript>
    function is_n()
    {
    event.srcElement.value = event.srcElement.value.replace(/[^\d]/g,""));
    }
    </script>PS:这样是可以的
    我怎么运气没那么好啊,没有误打误撞加了转义符号
    ^o^  ^0^
      

  4.   

    :)<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">调用时候不要括号()
      

  5.   

    一般在给事件增加事件处理函数的时候就不需要括号,例如attachEvent;其他情况一般都是要的小狗在他的收藏贴里也提到了expression啊,你没看?
      

  6.   

    http://www.blueidea.com/bbs/NewsDetail.asp?id=454714
      

  7.   

    thx。以后有什么要帮忙的说一声。