javascript - Removing focus from an input element so the page can be scrolled using the arrow keys? -


i have page few text box inputs. default, first text box has focus (the cursor waits inside text box user start typing) page loads.

although convenient, means up/down arrow keys cannot used scroll page.

i tried:

  // when down key pressed...   $("body").focus(); // or...   $("body").first().focus(); // or...   $("a:visible").first().focus(); 

but doesn't work. still have click outside of input box in order start using up/down arrows scroll again.

use this, solve problem.

$(function(){     $("input").blur(); } 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -