13
I’d like to know the difference between keyup()
, keydown()
and keypress()
, in my opinion I think they do the same thing, but what is the purpose of each?
Performance improvement for each type?
13
I’d like to know the difference between keyup()
, keydown()
and keypress()
, in my opinion I think they do the same thing, but what is the purpose of each?
Performance improvement for each type?
25
They don’t really do the same thing.
keyup(): the event occurs when the key returns to the original position on the keyboard (i.e. when you release it).
keydown(): the event occurs when the key is pressed. The event repeats while the key is pressed (except for the keys Ctrl, Alt and Shift).
keypress(): the event occurs when the key is pressed. The event repeats while the key is pressed (except for the keys Ctrl, Alt and Shift).
The difference between keydown() and keypress() is that the second is not captured when the keys Ctrl, Alt or Shift are pressed.
Browser other questions tagged jquery html
You are not signed in. Login or sign up in order to post.
If they are used to capture keys, only the keypress is case-sensitive.
– Huskell
Thanks a lot, tmj!
– viniciussvl
Boleta show.
– Gato de Schrödinger