Whenever a key is triggered, the keyup() method binds function to an event on an element. This event occurs when key is released in the keyboard. When you run the above example, you would get the following output:
#Jquery keyup function example code
It will run once the page document object model is ready for JavaScript code to execute.
![jquery keyup function example jquery keyup function example](https://i.stack.imgur.com/f324T.png)
It triggers the keypress event for selected elements. The keypress event is not fired for all keys such as Shift, Ctrl, Alt, Insert, Home, Page Up, Delete, End, Page Down, and Caps Lock. So it is useful when you have to differentiate between lowercase and uppercase. The keypress event returns different values for lowercase and uppercase letters. This method is used to perform any action or run a function as keypress event occurs in your web document. Whenever a key is pressed, the keypress() method binds function to an event on an element. It is quite similar to keydown element and occurs when a button is pressed down. It is used to count number of key presses in the output field. The keypress event occurs when user presses a key on the keyboard. It triggers the keydown event for selected elements.
![jquery keyup function example jquery keyup function example](https://i.stack.imgur.com/tZlHM.png)
By pressing some keys which will trigger only keydown event such as Shift, Ctrl, Alt, Insert, Home, Page Up, Delete, End, Page Down, and Caps Lock. It can be attached to any element, but the event is only sent to the element that has the focus. The keydown event is sent to an element when user presses a key on the keyboard. Whenever a key is pressed down, the keydown() method attaches event handler to the keydown JavaScript event or triggers that event on an element. The keydown event occurs when user presses a key on the keyboard.