How to user mask for Phone/Zip Code or Other in Jquery?

By Adil Shahbaz   Posted on April-12-2018 

How to user mask for Phone/Zip Code or Other in Jquery?

Step 1:

<input name="phone" id="phone" type="text" required>

Step 2:

Add CDN

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.maskedinput/1.4.1/jquery.maskedinput.js"></script>

 

Step 3:

    <script>
        jQuery(function ($) {
            $("#phone").mask("9999-9999999");
        });
    </script>

Step 1:

<input name="phone" id="phone" type="text" required>

Step 2:

Add CDN

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.maskedinput/1.4.1/jquery.maskedinput.js"></script>

 

Step 3:

    <script>
        jQuery(function ($) {
            $("#phone").mask("9999-9999999");
        });
    </script>

By Adil Shahbaz    12-Apr-2018 



You may also read following recent articles