Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

HTML autocapitalize Attribute

  • Last Updated : 14 Nov, 2021

The HTML autocapitalize attribute is used to define whether the text present inside the HTML element should be automatically capitalized or not. It is a global attribute that means it is applied to all HTML elements.


  • It specifies how the text will be automatically capitalized.
  • It indicates that the first letter of the word or sentence would be in Capital.
  • It does not support <input> tag with type URL, Email, and Password.
  • It is a Global Attribute.


<tag_name autocapitalize="off | none | on 
          | sentences | words | characters" />


Attribute Values:

  • off/none: It defines that the text will not be capitalized.
  • on/sentences: It defines that the first letter of each sentence would be capital.
  • words: It defines that the first letter of each word would be capital.
  • characters: It specifies that the whole text will be capitalized.

Example: Below HTML code use the auto-capitalize attribute with the <input> Tag.  


<!DOCTYPE html>
        HTML | autocapitalize Attribute
<body style="text-align:center">
    <h1 style="color: green;">
        HTML | autocapitalize Attribute 
        with <input> Tag
    <input type="text" autocapitalize="words" autofocus>
    <!-- Assign id to the Button. -->
    <button id="GFG">


Important Note: This code is working on virtual keyboards such as on mobile devices and voice inputs. It is not working on physical keyboards.

Supported Browsers:

  • Google Chrome 43.0
  • Apple Safari 5.0

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!