The HTML attribute that automatically focuses an input element on page load is autofocus. It is a Boolean global attribute, so its presence is enough; HTML does not require a value such as autofocus="true". For example, <input autofocus> asks the browser to place the initial focus in that control.
Although commonly associated with inputs, autofocus can apply to other focusable or editable elements, including controls inside dialogs. In a document, dialog, or popover, only one element should normally use it. If several elements have the attribute, the browser focuses the first eligible one according to document order and focusability rules.
Autofocus is different from autocomplete. autocomplete controls whether the browser may suggest or fill previously entered data; it does not select the control. The tabindex attribute also affects focus behavior, but primarily determines whether an element can receive focus and how it participates in keyboard navigation.
Automatic focus can improve a search or sign-in form, but it may also scroll the page, open a mobile keyboard, or disorient screen-reader users. Use it selectively, especially when the page has useful introductory content before the form.