keecode logokeecode

3

99

Number Pad 3

event.keyCode

99

event.key

3

event.code

Numpad3

Unicode

Code Examples

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

Recommended modern approach

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

Related Keys

Other keys commonly used together or in similar contexts