Search
 
SCRIPT & CODE EXAMPLE
 

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 
Comment

PREVIOUS NEXT
Code Example
Javascript :: window.print specific div 
Javascript :: trigger many calls JS 
Javascript :: java script loup object 
Javascript :: how to get node modules 
Javascript :: string format javascript 
Javascript :: array object make api format javascript 
Javascript :: translate from json string to object c# 
Javascript :: javascript one line if without else 
Javascript :: bytes to uppercase hex javascript 
Javascript :: microseconds to current time js code 
Javascript :: javascript ignore a function if viewed in mobile 
Javascript :: javascript get element by class domlist undefined 
Javascript :: code mirror get value from dom 
Javascript :: jquery dropdown options in laravel 
Javascript :: Using a fallback if module loading fails 
Javascript :: how we pass 2 args in switch case javascript 
Javascript :: typeorm with better sqlite Loading from the database 
Javascript :: react app environment variables undefined even when starts with REACT_APP_ 
Javascript :: react redux reducer add objects to reducer 
Javascript :: reactjs upload to firebase with custom id 
Javascript :: mindate from another datepicker 
Javascript :: Classes and constructor functions in ES6 
Javascript :: json_populate_recordset 
Javascript :: expo google sign inredirect uri mismatch 
Javascript :: External javascript in React Native 
Javascript :: set state giving previously update data 
Javascript :: conditionally add property to object 
Javascript :: discord.js play song 
Javascript :: underscore js shuffle 
Javascript :: How to check for the properties of an element in the console 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =