-->

HTML page with input type tel and attribute pattern.

On website, we may want to input telephone number or mobile number, how to do that?
We have one input type named tel. further we can understand from following example.
----------------------------------------------------------------------------------------------------------
<html><!--root tag-->

<head><!--used for meta tag-->
    <title><!--title tag-->
        form with input type tel
    </title>
</head>

<body><!--is a container-->
    form <br>
    <form><!--opening of form tag-->
        enter telphone number in 123-456-7890 pattern
        <input type="tel" pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}" placeholder="123-456-7890" required>
        <!--accepts telephone number. pattern is the pre-definedd format. If we donot follow, it will not accept-->
    </form>
</body>

</html>

No comments:

Post a Comment