Related Articles

Related Articles

HTML | <textarea> autofocus Attribute
  • Last Updated : 29 Apr, 2019

The HTML <textarea> autofocus Attribute is used to specify that the textarea field should get automatically focus when the page loads. It is a Boolean Attribute.

Syntax:

<textarea autofocus>

Example: This Example illustrates the use of autofocus attribute in Textarea Element.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>
      HTML textarea autofocus Attribute
  </title>
</head>
  
<body style="text-align:center">
    <h1 style="color: green;">
      GeeksforGeeks
  </h1>
    <h2>
      HTML <Textarea
      autofocus Attribute
  </h2>
        <textarea id="geeks"
                  autofocus>
          write something here----
  </textarea>
</body>
  
</html>

chevron_right


Output:

Supported Browsers: The browser supported by HTML | <Textarea>autofocus Attribute are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

full-stack-img

My Personal Notes arrow_drop_up
Recommended Articles
Page :