This may be a bit if we have a keyboard user (either using a screen reader or just a regular keyboard user) who expects to follow the links at the top of the page the first time Tab is pressed. For screen readers, you might also consider adding WAI-ARIA to add routes if users who do not expect to be dropped in the middle of the form.
If it is much more likely that the user wants to immediately enter text in the field, I think that autofocus is worth it. But for the reason above, I would not use it on every page with an input field.
If you are performing autofocus, be sure to do it immediately, in the script, as soon as possible after the input element or in the future using the HTML5 autofocus attribute. Do not do this until window.onload . This is annoying when you click the focus elsewhere, only for the document to finish loading late and steal the focus on another item as you type.
bobince
source share