5
101
Number Pad 5
event.keyCode
101
event.key
5
event.code
Numpad5
Unicode
⑤
Code Examples
Copy and paste these examples to detect the 5 key in your JavaScript code
Recommended modern approach
// Modern approach (recommended)
document.addEventListener('keydown', (e) => {
if (e.key === '5') {
console.log('5 key pressed!');
// Your code here
}
});Related Keys
Other keys commonly used together or in similar contexts