Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

spacebar event listener

document.body.onkeyup = function(e) {
  if (e.key == " " ||
      e.code == "Space" ||      
      e.keyCode == 32      
  ) {
    //your code
  }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #spacebar #event #listener
ADD COMMENT
Topic
Name
6+1 =