Usage of autofocus HTML5 attribute

HTML5 introduced a new attribute called autofocus that would be used as follows:

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

This attribute is supported by latest versions of Mozilla, Safari and Chrome browsers only.


You can try to run the following code to learn how to work with autofocus attribute:

      <form action = "/cgi-bin/html5.cgi" method = "get">
         Enter email : <input type = "text" name = "newinput" autofocus/>
         <p>Try to submit using Submit button</p>
         <input type = "submit" value = "submit" />
karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know