D
D
Dmitry2021-12-25 11:41:18
JavaScript
Dmitry, 2021-12-25 11:41:18

How to translate imask plugin code from webpack to vanilla javascript?

import Inputmask from "inputmask";

const tels = document.querySelectorAll("input[type=\"tel\"]");
const im = new Inputmask("+7 (999) 999-99-99");
im.mask(tels);


There is such a code on the imask plugin, this is a mask for input, but it is written to work under webpack and the plugin code is imported in it. I connected the cdn of the plugin, how can I write the same code without import, in vanilla javascript?

import Inputmask from "inputmask";

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question