What do you need to write in parentheses to activate the event handler after pressing the key 2?
document.addEventListener("keydown", function(e) {
if (...) {
console.log(e);
}
});
Write only the missing part.
What do you need to write in parentheses to activate the event handler after pressing the key 2?
document.addEventListener("keydown", function(e) {
if (...) {
console.log(e);
}
});
Write only the missing part.
Create a free account to access the full topic