English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The autofocus attribute is a boolean attribute, which specifies that the text area should automatically gain focus when the page is loaded.
An automatically focused text area:
<textarea rows="4" cols="50" autofocus> At oldtoolbag.com will learn how to make a website. We offer free tutorials in all web development technologies. </textarea>Test and see ‹/›
IEFirefoxOperaChromeSafari
Internet Explorer 10, Firefox, Opera, Chrome, and Safari support the autofocus attribute.
Note:Internet Explorer 9 and earlier versions support the autofocus attribute of the <textarea> tag.
The autofocus attribute is a boolean attribute.
The autofocus attribute specifies that the text area should automatically receive focus when the page is loaded.
The autofocus attribute is an HTML5 New attributes for the <textarea> tag.
In XHTML, attribute shorthand is prohibited, and the autofocus attribute must be defined as <textarea autofocus="autofocus">.
<textarea autofocus>HTML <textarea> tag