Dofactory.com
Dofactory.com
Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

HTML autocapitalize Attribute

The autocapitalize attribute specifies that the text entered by the user should automatically be capitalized.

This 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




Last updated on Sep 30, 2023

Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

Guides