I was writing an javascript application. I used something like
document.keypress = function(e) {
    switch(e.which){ 
    case 97: 
    alert('foobar');
    break;
    .......
And it works fine! Now, somewhere in the html page i have a textarea, Now, whenever i type a (i.e, ASCII 97) then it alert's (obviously).
The question is how do i prevent this? with my keypress event working for everything except inside textareas, and text fields?
 
     
     
     
     
     
     
    