如题,请高手指教。谢谢!!!我写的在火狐下不好用。请大家解决一下!!

解决方案 »

  1.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <base href="http://docs.jquery.com" />
    <script src="http://code.jquery.com/jquery-latest.js"></script>
     
    <script>
    window.onload = (function(){
    $("button").click(function(){alert(this.innerText)});
    $("button").keydown(function(e){
    if(e.keyCode==13){
    $(this).next().focus();
    return false;
    }
    });
    });
    </script>
    <style> 
     
      table {
        background:#eeeeee;
      }
      
    </style>
    <style>html,body{border:0; margin:0; padding:0;}</style></head>
    <body>
    <button>sort</button><button>ddd</button><button>aaa</button>
    </body>
    </html>
      

  2.   

    我在单纯的js中怎么写 我把代码复制上去不好用 我的js 中有一个onload="Fx_Document_OnLoad();"所以我在Fx_Document_OnLoad()函数中怎么写进去啊 还有我是实现回车键替代tab主要是textBox 如果遇到button就响应事件了。谢谢。
      

  3.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <script>
    function Fx_Document_OnLoad(){
        var obj=document.getElementsByTagName("input");
        
        for(var i=0;i<obj.length;i++){
            obj[i].onkeydown=function(){
                if(event.keyCode==13){
                    event.keyCode = 9;
                }
            };
        }
    }
    </script>
    </head>
    <body onload="Fx_Document_OnLoad();">
    <input type=text><input type=text><input type=text>
    </body>
    </html>
      

  4.   

    楼上的好像只能在ie中实现,请问firefox中怎么实现?
      

  5.   

    function keydown(e)
    {
    var e=e||event;
    var currKey=e.keyCode||e.which||e.charCode;
    if(currKey = 13)
    currKey = 9;
    }