HTML <textarea> autofocus attribute
Definition and Usage
autofocus
The attribute is a boolean attribute.
When present, it specifies that the text area should automatically receive focus when the page is loaded.
Example
Text area that will automatically receive focus:
<textarea autofocus> At codew3c.com, you will learn how to develop websites. We provide free tutorials for all Web development technologies. </textarea>
Syntax
<textarea autofocus>
Browser Support
The numbers in the table indicate the first browser version that fully supports this attribute.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | 10.0 | 4.0 | Support | Support |