So I want to call a function when the space bar is pressed on the page. The only problem is thought that the function can NOT be called if it's focused in an input bar. Any ideas on how to do that?
This code works, but still fires the function when focused in an input bar
$(document).keydown(function(e){
if (e.keyCode==32) {
stopplay();
}
});