document.getElementById(txtFind).onkeyup=hello

解决方案 »

  1.   

    我就是这么写的,不管用呀,hello()是拼起来的字符串
      

  2.   

    不能光写hello,我里面有好多参数的呀
      

  3.   

    mingxuan3000(铭轩) ( ) 信誉:100    
    ----------------
    帮帮忙吧,不加参数可以。
    我里面有参数,怎么实现呀,很着急呀
      

  4.   

    <input type="text" id="aaa" value="2">
    <SCRIPT LANGUAGE="JavaScript">var txtFind="aaa"
    var cc="123"
    document.getElementById(txtFind).onclick=new Function ( "hello("+cc+")")
    function hello(a){
      alert(a)
    }
    </SCRIPT>
      

  5.   

    噢,我写成string funStr="\"hello()\""
    document.getElementById(txtFind).onclick=new Function(funStr);了,
    多加了个转义符,
    谢谢了
      

  6.   

    <input type="text" name="danjia" onkeyup="setdanjia(this.value)">