Javascript onkeypress delete or dot

Is there any way to find out if the user has pressed the delete key or the dot? It has the same key in FireFox.

+3
source share
2 answers

According to keystroke detection , possibly provided that:

  • you are looking for key code ( 8 to remove) onkeydown / up and
  • ignore both onkeypress and charCode (especially if you think that IE does not fire the event with the key pressed, only the up / down key).
+3
source

Here's a good overview of browser behavior when it comes to keyboard events:

JavaScript Madness: Keyboard Events (most recently: July 7, 2008)

"3.2. , ", , , .

: .

+6

Source: https://habr.com/ru/post/1699656/


All Articles