"keydown" is an event used in writing software that is triggered when a key on the keyboard is being pressed


The event that happens when a key on the keyboard gets lifted up after pressing it.

Multiple stick example

Quality Example
Just better

"They have their differences better stick to one i prefer for this example to use keydown just plays better with me you can use keyup"

from question "Keydown event in drop down list"

More preferable

"Keyup is more preferable than keydown because keydown may occur multiple times if user keeps it pressed"

from question "Which keycode for escape key with jQuery"


"Also note that keydown is better for this methodology as keyup will fire multiple times though i guess this will too."

from question "Javascript move text between brackets in textarea"

Little element silently-ish

Quality Example

"Also if you notice i ve changed the keyup event to keydown which is better in my opinion cause when the user holds their finger down on a button the code wouldn t be fired if it is on the keyup event"

from question "Detecting when a scrollbar appears on texarea"

"Edit keydown is a little better than keyup for the element bind now enter key fails silently-ish"

from question "Prevent form submission on enter key"

Events right value

Quality Example

"Then the right events to do it is keyup more than keydown since the value isn t yet in the field at this moment or on change"

from question "How to use value in input type number for calculate and set value in to other input?"


"As you can see the keyup events of numpad5 and numpad6 occured earlier than their keydown event"

from question "C# KeyUpEvent occurs before KeyDownEvent"


Quality Example
More sense

"Also note that using keyup or input makes far more sense than keydown otherwise the previous value will only be evaluated on the next event occurrence"

from question "InArray doesn't recognize this.value but recognize normal numbers"

Earlier first

"The events seem to not follow strict sequential rules second keydown comes earlier than first keyup so the timer gets initialized multiple times"

from question "JavaScript timeout fires 3 times instead of once (clearTimeout is not working ?)"

Smoother transition

"In my test keyup gives a smoother transition as compared to keydown"

from question "Silverlight Combobox Fire KeyDown event when combobox is open"

Back to Home
Data comes from Stack Exchange with CC-BY-SA-3.0