Click here to Skip to main content
15,918,742 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Fetch ascii code for keys using array in JavaScript?
Posted
Comments
Sergey Alexandrovich Kryukov 26-Jan-15 2:14am    
Not clear. First think to understand: keys are not directly associated with "ASCII code", and not all keys are related to ASCII, ever. Not clear what are you talking about the array, and what keys you mean, and so on.
—SA

1 solution

Looking at your question, I guess, you are looking for either finding ASCII code from character or Key Codes/ Char Codes from keys. Not sure about why you have used the word "array" though.

To find ASCII code from character-
JavaScript
var a = 'a';
alert(a.charCodeAt());

List of ASCII Codes[^]

Following links may help finding key codes/char codes
How to find the key code for a specific key[^]
KeyboardEvent.keyCode[^]

Hope, it helps :)
In case you are looking for something else, please let me know with little better description about your problem.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900