回車鍵轉(zhuǎn)為Tab鍵
IE下可以實(shí)現(xiàn),代碼如下
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>無標(biāo)題文檔</title>
- <script type="text/javascript">
- function enterToTab(event){
- var e = event?event:window.event
- if(e.keyCode == 13){
- e.keyCode = 9;
- }
- }
- </script>
- </head>
- <body>
- <form>
- <input id="input1" type="text">
- <input id="input2" type="text">
- <input id="input3" type="text">
- <input id="input4" type="text">
- </form>
- </body>
- </html>
但是在FireFox下事件的keyCode 是只讀的,不能修改,不知火狐下如何實(shí)現(xiàn)這個(gè)功能