Simply I have a js script that change the page with left and right arrows, but how to stop that if a specific textarea is selected ?

This is my js to change the page

```
$(document).keydown(function(event) {

    if(event.keyCode === 37) {
          window.location = "http://site.com/pics/5";
    }    
    else if(event.keyCode === 39) {
          window.location = "http://site.com/pics/7";
    }
});

```