পেজ লোড হওয়ার সাথে সাথে কোন এলিমেন্টকে স্বয়ংক্রিয়ভাবে ফোকাস করতে autofocus অ্যাট্রিবিউট ব্যবহার করা হয়।
উদাহরণ
HTML-এ autofocus অ্যাট্রিবিউট বাস্তবায়নের উদাহরণ:
<!DOCTYPE html> <html> <body> <p>Click on the below button to generate an alert box.</p> <button type = "button" autofocus onclick = "alert('Welcome!')">Result</button> </body> </html>