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++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -