/

HTML / CSS / JavaScript Tutorial

HTML Standard attribute: autofocus

[this page | pdf | back links]

The HTML autofocus attribute indicates whether an element should automatically get focus when the page loads. It applies to <button>, <input>, <keygen>, <select> and <textarea> elements.

 

Valid attribute values (when used with <button>, <input>, <keygen>, <select> and <textarea> elements) include:

 

Value

Description

autofocus

Element should automatically get focus when page loads

 


NAVIGATION LINKS
Contents | Prev | Next | HTML Attributes


Desktop view | Switch to Mobile