Monday, May 13, 2024
 Popular · Latest · Hot · Upcoming
18
rated 0 times [  19] [ 1]  / answers: 1 / hits: 53175  / 15 Years ago, sun, december 13, 2009, 12:00:00

ok, i need my code to check if minus/subtract/- was pressed, if it was pressed i want an alert box to pop. i tried with both 109 and 189 key codes but i still don't get the desired result. although i press - i don't get that alert box


More From » keycode

 Answers
13

The JavaScript charCodes, which you test for during a keypress event, are ASCII. 109 is the correct keyCode, if used in a keydown or keyup event.



- has a charCode of 45.


[#98078] Thursday, December 10, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jarettajb

Total Points: 678
Total Questions: 94
Total Answers: 90

Location: Guernsey
Member since Tue, Jul 6, 2021
3 Years ago
;