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