phone-mask-native
v1.2.9
Published
The plugin activates the mask when entering phone numbers. Belarusian and Russian numbers are supported, the rest are introduced without a mask.
Maintainers
Readme
phone-mask-native
The plugin activates the mask when entering phone numbers. Most countries with mobile communications are supported, including Belarus, Russia, Ukraine, Poland, Czech Republic, etc. Numbers of countries that are not supported will be indicated without a mask.
Install
CDN
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/phone-mask-native.min.js"></script>or
<script src="https://unpkg.com/[email protected]/dist/phone-mask-native.min.js"></script>Import
Run the command in the console
npm i phone-mask-nativePerform the import
const phoneMaskNative = require('phone-mask-native');or
import phoneMaskNative from 'phone-mask-native';Option (selector)
Type: string
Default: input[data-phone-input]
The selector of the input fields of telephone numbers (you can also use the text input field).
Usage
CDN
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/phone-mask-native.min.js"></script>
...
<script>
phoneMaskNative();
</script>or
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/phone-mask-native.min.js"></script>
...
<script>
phoneMaskNative('your-selector');
</script>Import
const phoneMaskNative = require('phone-mask-native');
phoneMaskNative('your-selector');or
const phoneMaskNative = require('phone-mask-native');
phoneMaskNative();Note
Many thanks for the main idea and help to the web-developer Alexei Goloburdin.
