javascriptjqueryeventskeyboardkeyboard-events

How to find the key code for a specific key


What's the easiest way to find the keycode for a specific key press?

Are there any good online tools that just capture any key event and show the code?

I want to try and find the key codes for special keys on a mobile device with a web browser, so an online tool would be great.


Solution

  •     $(function () {
          $(document).keyup(function (e) {
             console.log(e.keyCode);
          });
        });
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

    Here's your online tool.