Html input, always in focus

Asked  Nov 14, 11:01 am 40 Views Add Your Answer
Asked  Nov 14, 11:01 am

How can I keep the html input always in focus? Using the autofocus attribute when creating the element helps to focus at pageload, but it does not keep the focus on the object. Is there any simple way to keep the focus there?

0 Dislikes
0 Comments

1 Answers

Added  Nov 14, 11:02 am

On blur event (unfocus) refocus the input:

html code
<p><input onblur="this.focus()" autofocus /></p>
<p><input value="Can't focus on this" /></p>

0 Likes 0 Dislikes
0 Comments
×
Google login
SignUp with Email
X