I am deactivating the left and right arrow keys when the page is loaded with the following:
$(document).keydown(function(event) {
switch(event.keyCode){
case 37:
case 39:
return false;
break;
}
});
I want to reactivate them when the textarea or a input field id onfocus, and deactivate them again when that element is not in focus anymore. How would you do that?
You could check the
event.target.