HTML autocapitalize Attribute
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" />
- 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.
Important Note: This code is working on virtual keyboards such as on mobile devices and voice inputs. It is not working on physical keyboards.
- Google Chrome 43.0
- Apple Safari 5.0