Into an input box, I want to stop the propagation of the cursor just as I type on the up key "↑" :
Before :
tes|t
// cursor is before t
After :
|test
// cursor went beginning
I want to prevent the cursor to move, so it has to stay before t.
So far, I'm trying with this, but it doesn't work :
$('input').keyup(function(e) {
if (e.which == 40) { // up key
e.stopPropagation();
e.stopImmediatePropagation();
e.preventDefault();
// actions
return false;
}
}
Is this possible anyway ?