Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

How to find out what character key is pressed?#key#keyCode#code

<table>
<tr><td>Key:</td><td id="key"></td></tr>
<tr><td>Key Code:</td><td id="keyCode"></td></tr>
<tr><td>Event Code:</td><td id="eventCode"></td></tr>
</table>
<script type="text/javascript">
window.addEventListener("keydown", function (e) {
  //tested in IE/Chrome/Firefox
  document.getElementById("key").innerHTML = e.key;
  document.getElementById("keyCode").innerHTML = e.keyCode;
  document.getElementById("eventCode").innerHTML = e.code;
})
</script>
Comment

PREVIOUS NEXT
Code Example
Javascript :: https request node.js output incomplete 
Javascript :: javascript find method 
Javascript :: react axios fetchData with loading screen plus API 
Javascript :: two dimensional array traversing in javascript 
Javascript :: javascript set elements width by tag name 
Javascript :: django csrf failed ajax 
Javascript :: separador de miles javascript 
Javascript :: using filter and pipe in rxjs 
Javascript :: material icons angular 
Javascript :: redux thunk 
Javascript :: change color in react 
Javascript :: phaser generate frame numbers 
Javascript :: launch json for golang with args 
Javascript :: json schema eg 
Javascript :: javaScript setMonth() Method 
Javascript :: mongoose encrypt database using mongoose encrypt package 
Javascript :: how to use hammerjs in ionic 5 
Javascript :: obfuscate js code 
Javascript :: Connect node.js with react.js 
Javascript :: onclick remove textarea value 
Javascript :: Convert pixels to number js 
Javascript :: print json object 
Javascript :: strapi blank dashboard page 
Javascript :: google scripts string split 
Javascript :: sequelize findall return 
Javascript :: how to get the value of AutoCompelet Component in MUI 
Javascript :: nodejs mysql error handling with user example 
Javascript :: JSON requests using API in Javascript 
Javascript :: rounding to two decimal places 
Javascript :: req.body is empty express js 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =