Easy Tutorial
❮ Tag Head Att Global Spellcheck ❯

HTML <textarea> autofocus Attribute

HTML <textarea> Tag

Example

A text area that automatically gains focus:


Browser Support

Internet Explorer 10, Firefox, Opera, Chrome, and Safari support the autofocus attribute.

Note: Internet Explorer 9 and earlier versions support the autofocus attribute for the <textarea> tag.


Definition and Usage

The autofocus attribute is a boolean attribute.

The autofocus attribute specifies that the text area should automatically get focus when the page loads.


Differences Between HTML 4.01 and HTML5

The autofocus attribute is new for the <textarea> tag in HTML5.


Differences Between HTML and XHTML

In XHTML, attribute minimization is forbidden, and the autofocus attribute must be defined as <textarea autofocus="autofocus">.


Syntax

❮ Tag Head Att Global Spellcheck ❯