- 1
forms autofocus
i really need to understand how the desired input is focus and how it can focus. and why is it necessary to use autofocus?
2 odpowiedzi
+ 2
I think it is already explained in the lesson itself. So, do not put these type of quetions here.
+ 1
It's not mandatory to use autofocus...
It's just a convenient way to determine wich form element got focus at page load: a textinput if you want let the user enter text without having to select the field, a button if you want let the user activate it just by a enter key press...
As you could define if a check box is initialy checked or not, or a select option list pre-selected (but conversely, autofocus is mandatory to be set to only one form element by page (not two elements could have the focus has the same time), unless the user overides it by its actions.