本帖最后由 starlit53 于 2011-06-01 10:09:29 编辑

解决方案 »

  1.   

    document.onkeydown 改成  document.getElementById("city").onkeydown 
    试试 。
      

  2.   

    document.getElementById("city").onkeydown  
    外层容器的onkeydown  好像不行哦,用了就上下键 就直接无效了。
      

  3.   

     <input type="text" id="words" />
            <script type="text/javascript">
                document.body.onkeydown = function () {                document.getElementById("words").value = "123";//function(){do smthing;}
                    //做完该做的,return false
                    return false;
                }
            </script>