<input class="input-number" type="text">
document.addEventListener("DOMContentLoaded", () => {
let inputs = document.querySelectorAll(".input-number");
let reg = /[A-Za-zA-Яа-яЁё]/g;
console.log("inputs", inputs);
inputs.oninput = function () {
this.value = this.value.replace(reg, "");
};
});
document.addEventListener("DOMContentLoaded", () => {
let inputs = document.querySelectorAll(".input-number");
let reg = /[A-Za-zA-Яа-яЁё]/g;
for (input of inputs) {
input.oninput = function () {
this.value = this.value.replace(reg, "");
};
}
});