I want to detect these two behaviours on an input field:
1)Backspace key
2)"@" and "#" key
By using jQuery's keypress
function, I am able to detect the special characters but not backspace.
LINK -> How to know if .keyup() is a character key (jQuery)
By using jQuery's keyup
/keydown
, I am able to detect backspace, but not special characters.
LINK -> jQuery: keyPress Backspace won't fire?
How can I detect both the behaviours ?
NOTE: Keypress
can detect backspace in firefox only. Chrome doesn't detect this.