Issue #14 - Autocapitalization
Control how virtual keyboards capitalize words and characters by default.
<input type="text" id="words" autocapitalize="words">
Let’s say you have an input field that demands users to enter text in lowercase letters only. If you focus the field, by default the virtual keyboard starts with uppercase letters. You can improve the experience for some users by changing the default auto-capitalization behaviour. By setting
none, virtual keyboards won’t capitalize letters automatically anymore.
<label for="none">All lowercase</label>
<input type="text" id="none" autocapitalize="none">
The attribute is supported by Safari on iOS and Chrome, Edge and Samsung Internet on Android. The attribute is not supported by Firefox on Android and it has no effect on physical keyboards.
none, there are three more allowed values:
- No autocapitalization should be applied (all letters should default to lowercase).
- All letters should default to uppercase.
- The first letter of each sentence should default to a capital letter; all other letters should default to lowercase.
- The first letter of each word should default to a capital letter; all other letters should default to lowercase.
Source: 6.7.6 Autocapitalization
Did you enjoy this tip?
Sign up for the HTMHell newsletter and receive an HTML tip or trick every week via e-mail.