Thuộc tính autofocus là thuộc tính boolean. Khi có mặt, nó chỉ định rằng phần tử <input> sẽ tự động nhận focus khi trang tải xong. Ví dụ:
<!DOCTYPE html>
<html>
<body>
<form action="/new.php">
First Name: <input type="text" name="fname" autofocus><br>
Last Name: <input type="text" name="lname"><br>
<input type="submit">
</form>
</body>
</html>