In below code if I press 'a' after some keys it should remove everything from input including but 'a' is not going away in below code.
const input = document.querySelector("input");
function type(e) {
if (e.key === "a") {
console.log("helo");
input.value = "";
}
}
window.addEventListener("keydown", type);
Aucun commentaire:
Enregistrer un commentaire