Computer scienceProgramming languagesJavaScriptInteraction with a browserDOM Events

Keyboard events handling

event.key

Report a typo

What do you need to write in parentheses to get the event handler that works after pressing V only?

document.addEventListener("keydown", function(event) {
  if (...) {
    return event;
  }
});

Write only the missing part.

Tip: Note that the symbol V is a capital letter and the property event.code cannot work with capital letters only.

Enter a short text
___

Create a free account to access the full topic