YouTip LogoYouTip

Prop Textarea Autofocus

# Textarea autofocus Property [![Image 3: Textarea Object Reference](#) Textarea Object](#) * * * ## Example Check if a textarea automatically gets focus: var x = document.getElementById("myTextarea").autofocus; [Try it Yourself Β»](#) ## Definition and Usage The autofocus property sets or returns whether a textarea 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 should automatically get focus when the page loads. * true - The textarea element automatically gets focus. * false - Default. The textarea element does not get focus. | * * * ## Technical Details Return Value: A Boolean. Returns true if the textarea automatically gets focus when the page loads, otherwise false. * * Textarea Object](#)
← Perl IntroJava String Intern β†’