Elements of type text
create basic single-line text fields. The Try It example in this section will help you make your first text element. Text elements also have many attributes that can be helpful such as list
, maxLength
, minLength
, size
, and a few more. The section also introduces client-side validation of text fields which will be covered in detail later.
The following non-standard attributes are also available on some browsers. As a general rule, you should avoid using them unless it can't be helped.
autocorrect
A Safari extension, the autocorrect
attribute is a string which indicates whether to activate automatic
correction while the user is editing this field. Permitted values are:
on
Enable automatic correction of typos, as well as processing of text substitutions if any are configured.
off
Disable automatic correction and text substitutions.
mozactionhint
A Mozilla extension, which provides a hint as to what sort of action will be taken if the user presses the Enter or Return key while editing the field.
This attribute has been deprecated: use the enterkeyhint
global attribute instead.