How does the autofocus attribute work in HTML?

autofocus automatically places the cursor in a specific form element when the page loads.

Example:

<input type="text" autofocus>