how do i listen to a keypress in javascript
window.addEventListener("keydown", (event) => {
console.log(event.key);
});let b = document.getElementById("body"); //making var for body
b.addEventListener("keydown", (evt) => {//when this happens
console.log(evt.keyCode); //log keycode
});
Also in JavaScript:
- not getting webhook post request json data in my laravel controller
- javascript is int in array
- ajouter javascript dans html
- firebase configuration on functions
- javascript for loop that prints 10 times
- js capitalize word
- 00:00:00 / 00:00:00 js
- Programação web com Node e Express Beneficiando-se da stack JavaScript
- react admin newrecords.foreach is not a function
- self invoked function javascript
- how to get a value into a react component
- Limit text to specified number of words using Javascript
- terrain generator in javascript
- es6 array sum javascript
- ajax call to load a page on scrolling
- js pow
- how to reload a module in node.js
- json object check if key exists java
- settimeout in angular
- anagram program in javascript
- find string in array javascript
- application/ld+json react
- JavaScript banner
- jquery set title