Language

Input Type Tel


Input type="tel" is used in the telephone number field. If type="tel" is used, it does not make it mandatory to provide any specific information in the input element. Telephone number validation can be done using the pattern attribute or the JavaScript setCustomValidity() method.

Input type tel usage method explained

Example

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
   <form>
        <label for="telePhone">Telephone Number</label>
        <input type="tel" id="telePhone">
        <input type="submit" value="Submit">
    </form>
</body>
</html>