I have code like this that uses the space function:
$(document).keypress(function (e) {
e.preventDefault();
if (e.which == 32) {
}
});
Unfortunately, this destroys all standard defaults.
It:
$(document).keypress(function (e) {
if (e.which == 32) {
e.preventDefault();
}
});
Unfortunately, inefficient.
How can I make this preventDefault just a space?
Thank.
Jourkey
source
share