Tiny Input Mask Library – Supermask.js

Category: Form , Javascript | July 7, 2020
Author: ViniChab
Views Total: 949 views
Official Page: Go to website
Last Update: July 7, 2020
License: MIT


Tiny Input Mask Library – Supermask.js


Supermask.js is a pure JavaScript input mask library for formatting and restricting values typed in a text field.

How to use it:

1. Download and insert the main JavaScript index.js into the HTML file.

<script src="index.js"></script>

2. Apply masks to your input fields with the CSS class of maskField. In this example, we’re going to create a US phone number input.

<input mask="(999) 999–9999" class="maskField">

3. Set the maximum number that can be entered. 5 means that any number larger than 5 is not allowed.

<input mask="(555) 555–555" class="maskField">

4. The library also supports letters.

<input mask="aAaAaA" class="maskField">

5. Alphanumeric letters are supported as well.

<input mask="0-A" class="maskField">



  • Enhancing mask enforcement and pasting


  • Allows dynamic mask change


  • JS Updated

You Might Be Interested In:

Leave a Reply