HTML <input> type Attribute
Example
<input type="tel" name="phone" pattern="[0-9]{3}-[0-9]{2}-[0-9]{5}">
Meaning
A control for entering a telephone number.
Provides a telephone keypad in some devices with dynamic keypads.
Additional Attributes
- list: The id of the
<datalst>element that contains the optional pre-defined autocomplete options. - maxlength: The maximum length, in UTF-16 characters, to accept as a valid input.
- minlength: The minimum length that is considered valid for the field's contents.
- pattern: A regular expression the entered value must match to pass constraint validation.
- placeholder: An example value to display inside the field when it has no value.
- readonly: A Boolean attribute which, if present, indicates that the field's contents should not be user-editable.
- size: The number of characters wide the input field should be onscreen.
Standard Syntax
HTML: <input type="tel">
XHTML: <input type="tel" />
Advertisement