Horje

How to add HTML <input type="tel">

Define a field for entering a telephone number.

Definition and Usage

The <input type="tel"> defines a field for entering a telephone number.

Note: Browsers that do not support "tel" fall back to being a standard "text" input.

Tip: Always add the <label> tag for best accessibility practices!


Browser Support

Syntax

<input type="tel">

index.html
Example: HTML
<label for="phone">Enter your phone number:</label>
<input type="tel" id="phone" name="phone" pattern="[0-9]{3}-[0-9]{2}-[0-9]{3}"> 

Output should be:

How to add HTML <input type="tel">




Type:
html
Category:
Web Tutorial
Sub Category:
HTML Tag
Uploaded by:
Admin