var t = document.activeElement;
if (t.type == "text")
  t.onKeyUp();

解决方案 »

  1.   

    sorry, 不对, 没看清题目, 不过点击button的时候,鼠标就在button上啊
      

  2.   

    <form >
    <input type="text" name="aa" id="txt1">
    <input type="text" name="bb" id="txt2">
    <input type="button" name="cc" in="btn">
    </form><script>
    btn.onclick=function(){
    txt1.onKeyUp()
    }txt1.onKeyUp=function(){
    alert("你调用了我!")
    }</script>
      

  3.   

    sorry,刚没测试,你看看这个:<BODY>
    <form name=frm id="frm">
    <input type="text" name="txt1" id="txt1" value="aaaaaa">
    <input type="text" name="txt1" id="txt2" value="bbbbbb">
    <input type="button" name="btn" id="btn" value="test">
    </form><script>
    function frm.btn.onclick(){
    frm.txt1.onKeyUp()
    }function frm.txt1.onKeyUp(){
    alert("你调用了我!")
    }</script>
      

  4.   

    或者这么些也行:
    <form name=frm id="frm">
    <input type="text" name="txt1" id="txt1" value="aaaaaa">
    <input type="text" name="txt1" id="txt2" value="bbbbbb">
    <input type="button" name="btn" id="btn" value="test">
    </form><script>
    frm.btn.onclick=function(){
    frm.txt1.onKeyUp()
    }frm.txt1.onKeyUp=function(){
    alert("你调用了我!")
    }</script>