I have a standard textbox and I've got jQuery on the page. I want to act when the user types a space into the textbox, I am however unsure of how to do this.
Can anybody give me a hand with this please?
I have a standard textbox and I've got jQuery on the page. I want to act when the user types a space into the textbox, I am however unsure of how to do this.
Can anybody give me a hand with this please?
var KEYS = {
SPACE: 32
};
$("#textbox").keyup(function(e) {
if (e.keyCode === KEYS.SPACE) {
console.log("Space key pressed");
}
});
References: