Michael Rader Michael Rader - 10 months ago 73
Javascript Question

Recognize the backspace and spacebar with jQuery

when a user clicks the spacebar or backspace I need to create a variable that stores the action so I can use it to manipulate an array. I want the backspace to delete a value in an array and the spacebar to create a space. How can I do this?


Maybe this can help you:

   if(e.keyCode == 8){
       // user has pressed backspace
   if(e.keyCode == 32){
       // user has pressed space