Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

key html

document.addEventListener('keydown', event => {
	console.log(event.key); // logs the key
	if (event.key == " ") {
		// Your code, when space is pressed
	} else if (event.key == "a") {
    	// Your code, when small a is pressed
    }
})
//  |  |  |  | 												   	   
//  V  V  V  V  If you don't know the keys use the source below 
Source by keycode.info #
 
PREVIOUS NEXT
Tagged: #key #html
ADD COMMENT
Topic
Name
8+1 =