S
S
Shenku2017-05-25 16:21:47
JavaScript
Shenku, 2017-05-25 16:21:47

How to find out the pressed letter?

I'm trying to catch the symbol in this way (see below) browsers work out with a bang, safari in the iPhone too, but the android says undefined, I need the symbol itself and not the symbol ID
<input id="aaa" type="text" />

$( '#aaa' ).keypress( function( event ) {
        var this_symbol = event.key;
        alert( this_symbol  );
    });

Thank you !

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stalker_RED, 2017-05-25
@Stalker_RED

Try event.char
https://developer.mozilla.org/en-US/docs/Web/Event...

R
Rostislav Ignatenko, 2017-05-25
@lepard

keycode.info
Look at this example, it might help. Both the button and the symbol are tracked here.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question