แอตทริบิวต์ autofocus เป็น boolean attribute เมื่อมีอยู่ จะระบุว่า <input> element ควรได้รับโฟกัสอัตโนมัติเมื่อหน้าโหลด ตัวอย่างด้านล่าง:
<!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>