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

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -