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