HTML autocapitalize Attribute

The autocapitalize attribute specifies that the text entered by the user should be automatically capitalized. The autocapitalize attribute is a global attribute that can be applied to any tag.

Example

#

A autocapitalize attribute on an <input> element.
This text field capitalizes the first letter of each word.

<input type="text" autocapitalize="words" 
       name="subject" value="Website Feedback" />

Using autocapitalize

The autocapitalize attribute specifies how text entered should be automatically capitalized.

It allows capitalization on the first letter of each sentence, or each word, or the entire text input.

Autocapitalization does not work with these <input> types: url, email, and password.

The autocapitalize attribute is a global attribute that can be applied to any tag.

Note:  The autocapitalize attribute is now deprecated and is no longer recommended by W3C.


Syntax

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

Values

#

Value Description
off | none Text will not be capitalized.
on | sentences The first letter of each sentence will be capitalized.
words The first letter of each word will be capitalized.
characters The entire text will be capitalized.

Did you know?

Did you know?

The autocapitalize attribute was introduced by Apple

Apple introduced the autocapitalize attribute on input and textarea elements in iOS 5.

It indicates how the browser should present the virtual keyboard for users to optimize text entries.

Browser support is limited for this feature.


Browser support

Here is when autocapitalize support started for each browser:

Chrome
43.0 May 2015
Firefox
Not supported
Edge
Not supported
Opera
Not supported
Safari
5.0 Jun 2010

You may also like



Guides