HTML DOM Tel Object
Tel Object
The Tel object represents an HTML <input type="tel"> element.
Note: The <input type="tel"> element is not supported in any of the major browsers. However, browsers that do not understand type="tel" will treat it like type="text"; so it is safe to use the telephone input (often used for mobile devices).
Access a Tel Object
You can access an <input type="tel"> element by using getElementById():
Tip: You can also access a Tel object by searching through the elements collection of a form.
Create a Tel Object
You can create an <input type="tel"> element by using the document.createElement() method:
Tel Object Properties
| Property | Description |
|---|---|
| autocomplete | Sets or returns the value of the autocomplete attribute of a telephone number field |
| autofocus | Sets or returns whether a telephone number field should automatically get focus when the page loads |
| defaultValue | Sets or returns the default value of a telephone number field |
| disabled | Sets or returns whether a telephone number field is disabled, or not |
| form | Returns a reference to the form that contains the telephone number field |
| list | Returns a reference to the datalist that contains the telephone number field |
| maxLength | Sets or returns the value of the maxlength attribute of a telephone number field |
| name | Sets or returns the value of the name attribute of a telephone number field |
| pattern | Sets or returns the value of the pattern attribute of a telephone number field |
| placeholder | Sets or returns the value of the placeholder attribute of a telephone number field |
| readOnly | Sets or returns whether the telephone number field is read-only, or not |
| required | Sets or returns whether the telephone number field must be filled out before submitting a form |
| size | Sets or returns the value of the size attribute of a telephone number field |
| type | Returns which type of form element the telephone number field is |
| value | Sets or returns the value of the value attribute of a telephone number field |
Standard Properties and Events
The Tel object also supports the standard properties and events.
Related Pages
HTML tutorial: HTML Forms
HTML reference: HTML <input> tag
HTML reference: HTML <input> type attribute

