Michael Rader Michael Rader - 1 year ago 157
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?

Answer Source

Maybe this can help you:

   if(e.keyCode == 8){
       // user has pressed backspace
   if(e.keyCode == 32){
       // user has pressed space
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download