Is it possible to rewrite this code to an Arrow Function?
const inputEl = document.querySelector("input");
inputEl.addEventListener("keyup", fixLength);
function fixLength() {
let inputString = inputEl.value;
if (inputString.length > 12) {
inputString = inputString.slice(0, 12);
inputEl.value = inputString;
}
}
Aucun commentaire:
Enregistrer un commentaire