Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto focus is not working for input field

Tags:

When I Press Login button one popup is shown.

In that popup I need default autofocus on Login Input field. Can I achieve that with HTML5/CSS only?

jsfiddle

<div class="main">     <div class="panel"> <a href="#login_form" id="login_pop" onclick="">Log In</a>      </div> </div> <!-- popup form #1 --> <a href="#x" class="overlay" id="login_form"></a>  <div class="popup">      <h2>Welcome Guest!</h2>      <p>Please enter your login and password here</p>     <div>         <label for="login">Login</label>         <input type="text" id="login" value="" autofocus />     </div>     <div>         <label for="password">Password</label>         <input type="password" id="password" value="" />     </div>     <input type="button" value="Log In" /> <a class="close" href="#close"></a>  </div>