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
});document.addEventListener("keydown", function(event) {
if (event.keyCode == 32) {
console.log("Space was pressed!");
}
});Easily check JavaScript KeyboardEvent properties (e.key, e.code, e.which,
e.keyCode… and more) with Key.js:
https://keyjs.dev
Also in JavaScript:
- remove commas and dollar sign from string js
- setinterval vs settimeout js
- como criar uam seessão com jsp
- split and join in node js
- how to make a div appear when clicked on in javascript
- how to update my package.json
- vue js default prop
- lootie file in react
- javascript change class of item
- settimeout js
- convert string to array js
- discord.js join voice channel
- javascript bind this syntax
- Node.JS gitignore
- how to filter object in javascript
- delete first character javascript
- jquery detect textarea change
- change input to required jquery
- django ajax without jquery
- javascript void(0) href
- clean collection mongoose
- how to send js array from ajax
- laravel fetch post
- get random reddit image link