kmunky
·
Dec 14, 2009
·
Viewed 46.3k times
·
Source
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
This is what I have now:
$("input").bind("keydown",function(e){
var value = this.value + String.fromCharCode(e.keyCode);
}
If the e.keyCode may not be an ASCII character (Alt, backspace, del, arrows, etc.)...
I would now need to trim …
I am trying this:
<input type="text" placeholder="some text" class="search" onkeydown="search()"/>
<input type="text" placeholder="some text" class="search" onkeydown="search()"/>
with some javascript to check whether the enter key is pressed:
function …
How to know if .keyup() is a character key (jQuery)
$("input").keyup(function() {
if (key is a character) { //such as a b A b c 5 3 2 $ # ^ ! ^ * # ...etc not enter key or shift or Esc or space ...etc
/* Do stuff */
}
});