Textarea autofocusProperty
Examples
Check whether the textarea automatically gets focus:
var x = document.getElementById("myTextarea").autofocus;
Try it Yourself »
Definition and Usage
The autofocus property is used to set or return whether the textarea text box should automatically get focus when the page loads.
Browser Support
| Property | |||||
|---|---|---|---|---|---|
| autofocus | Yes | 10.0 | Yes | Yes | Yes |
Syntax
Return the autofocus property:
textareaObject.autofocus
Set the autofocus property:
textareaObject.autofocus = true|false
Property Values
| Value | Description |
|---|---|
| true|false |
Specifies whether the textarea text box automatically gets focus when the page loads.
|
Technical Details
| Return Value: | A Boolean value, returns true if autofocus is set when the page loads, otherwise false. |
Other Extensions
Textarea Object