asp.net.ph

Skip Navigation Links

AUTOCAPITALIZE Attribute | autocapitalize Property

Language References


Controls whether inputted text is automatically capitalized.

Syntax


Inline <element autocapitalize = sBehavior...>
Script object.autocapitalize = sBehavior ]

NOTE: autocapitalize does not affect behavior when typing on a physical keyboard.

It affects the behavior of other input mechanisms such as virtual keyboards on mobile devices and voice input. This can assist users by making data entry quicker and easier, for example by automatically capitalizing the first letter of each sentence.

Possible Values


sBehavior Character string that denotes in what manner capitalization is applied.

The property is read/write with a browser-dependent default value.

Remarks

autocapitalize is a global attribute with enumerated values that control whether inputted text is automatically capitalized and, if so, in what manner.

autocapitalize can be set on <input> and <textarea> elements, and on their containing <form> elements.

When autocapitalize is set on a <form> element, it sets the autocapitalize behavior for all contained <input>s and <textarea>s, overriding any autocapitalize values set on contained elements.

autocapitalize has no effect on the url, email, or password input types, where autocapitalization is never enabled.

When not specified, the adopted default behavior varies between browsers. For example:

  • Chrome and Safari default to on/sentences
  • Firefox defaults to off/none.

Example

The following is a sample form to test different autocapitalize settings.

NOTE: Test the effect on each input using a virtual keyboard or voice entry. Keyboard entry will not work.

Sample Code

Applies To

INPUT   TEXTAREA



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note