Last Updated : 20 May, 2024
The HTML <input type="tel"> element creates a telephone number input field, specifically designed for entering phone numbers. It provides features like input validation for telephone numbers and may include special characters like parentheses and hyphens for formatting. This element helps ensure that users enter phone numbers correctly in web forms.
Syntax<input type="tel">
Example: This example demonstrates the use of HTML <input type="tel"> element.
HTML
<!DOCTYPE html>
<html>
<head>
<title>HTML Input Type Tel</title>
</head>
<body style="text-align:center;">
<h2>HTML <input type="tel"></h2>
<form action="#">
<label for="contact">Phone No:</label>
<input type="tel" id="contact"
pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}"
required />
<input type="submit" value="Submit">
</form>
</body>
</html>
Output
Supported BrowsersRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4