keecode logokeecode

0

96

Number Pad 0

event.keyCode

96

event.key

0

event.code

Numpad0

Unicode

Code Examples

Copy and paste these examples to detect the 0 key in your JavaScript code

Recommended modern approach

// Modern approach (recommended)
document.addEventListener('keydown', (e) => {
  if (e.key === '0') {
    console.log('0 key pressed!');
    // Your code here
  }
});

Related Keys

Other keys commonly used together or in similar contexts