Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

keypress event

document.addEventListener("keypress", function(e) {
	e = e || window.event;
	// Add scripts here
	e.keyCode; // -> returns the keycode of the key that triggered the event
	e.key.toString(); // -> returns the ASCII character of the key that triggered the event
});
Source by matt-destroyer.github.io #
 
PREVIOUS NEXT
Tagged: #keypress #event
ADD COMMENT
Topic
Name
3+5 =