Rebind keypress to element after unbound with one() method ?
I'm trying to rebind a button that was previously unbound with the one() method, like this:
- $(document).one('keypress', 'button', function(e){
- // do something once here ...
- }).on('keyup', 'button', function(){
- // How to rebind keypress to button ?
- });
Because the keypress event triggers non-stop while a key is continuously pressed, I use the one() method to trigger function only once, and because I need keypress in order to use String.fromCharCode(e.which), how can I rebind button to
keypress using the keyup event?
UPDATE