html5 输入框响应enter按键

code

<html>
    <body>
     
    <input onkeydown="if(event.keyCode==13) {test()}"/>
     
    <script>
        function test() {
           alert(123);
        }
    </script>
     
    </body>
 </html>

 

 

 

 

 

 

posted @ 2020-08-19 17:30  anobscureretreat  阅读(1244)  评论(0)    收藏  举报