keecode logokeecode

6

102

Number Pad 6

event.keyCode

102

event.key

6

event.code

Numpad6

Unicode

Code Examples

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

Recommended modern approach

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

Related Keys

Other keys commonly used together or in similar contexts