![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
vanilla-text-mask
Advanced tools
JavaScript function that makes input HTML element accept mask pattern
Note: IE9 is not supported in this module.
First, install it.
npm i vanilla-text-mask --save
Then, use it as follows:
<script
type="text/javascript"
src="./node_modules/vanilla-text-mask/dist/vanillaTextMask.js"></script>
<script type="text/javascript">
var phoneMask = ['(', /[1-9]/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/]
// Assuming you have an input element in your HTML with the class .myInput
var myInput = document.querySelector('.myInput')
var maskedInputController = vanillaTextMask.maskInput({
inputElement: myInput,
mask: phoneMask
})
// Calling `vanillaTextMask.maskInput` adds event listeners to the input element.
// If you need to remove those event listeners, you can call
maskedInputController.destroy()
</script>
As you can see in the code above, you are passing an object to vanillaTextMask.maskInput(...)
.
The object takes inputElement
, which is the <input/>
element that you are masking. It also
accepts other values which are
documented here.
To see an example of the code running, follow these steps:
git clone git@github.com:text-mask/text-mask.git
cd text-mask
npm install
npm run vanilla:dev
The code of the example is in vanilla/example
.
We would love some contributions! Check out this document to get started.
FAQs
JavaScript function that makes input HTML element accept mask pattern
The npm package vanilla-text-mask receives a total of 186 weekly downloads. As such, vanilla-text-mask popularity was classified as not popular.
We found that vanilla-text-mask demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.