javascript - How to make default focus on the search bar on a web page, as Google does -


i trying make website. completed, few details done.

i have small problem , wasn't able find solution on internet.

when index page on site loaded want focus on search bar automatically, person can load page , start typing in order search.

the site has jquery library included.

you can accomplish using autofocus attribute:

<input type="text" name="searchbar" autofocus /> 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -