Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

keyboard event js

document.addEventListener("keydown", function(event) {
  console.log(`Key pressed: ${event.key}`);
  // event.key is a string representing which key has been pressed
});
 
PREVIOUS NEXT
Tagged: #keyboard #event #js
ADD COMMENT
Topic
Name
4+2 =