ArrowUp
38
up arrow
event.keyCode
38
event.key
ArrowUp
event.code
ArrowUp
Unicode
↑
Code Examples
Copy and paste these examples to detect the ArrowUp key in your JavaScript code
Recommended modern approach
// Modern approach (recommended)
document.addEventListener('keydown', (e) => {
if (e.key === 'ArrowUp') {
console.log('ArrowUp key pressed!');
// Your code here
}
});Common Use Cases
How the ArrowUp key is typically used in web applications
Navigate Lists
Move up in dropdown menus and lists
Game Movement
Move character or cursor up in games
Command History
Navigate through previous commands in terminals
Related Keys
Other keys commonly used together or in similar contexts