ArrowLeft
37
left arrow
event.keyCode
37
event.key
ArrowLeft
event.code
ArrowLeft
Unicode
←
Code Examples
Copy and paste these examples to detect the ArrowLeft key in your JavaScript code
Recommended modern approach
// Modern approach (recommended)
document.addEventListener('keydown', (e) => {
if (e.key === 'ArrowLeft') {
console.log('ArrowLeft key pressed!');
// Your code here
}
});Common Use Cases
How the ArrowLeft key is typically used in web applications
UI Navigation
Navigate through menus, lists, and form elements
Media Control
Rewind or seek backward in media players
Game Movement
Move character or cursor left in games
Related Keys
Other keys commonly used together or in similar contexts