Hello everyone! I've been a long time reader, but this is my first time posting. I'm completely new to this and need some help. How can I modify the code so that "ele.click();" will be triggered multiple times with a single press of the "Z" key? I want it to fire 5 times in a row like Z Z Z Z Z. Thank you in advance!
(function(tags) {
tags = ["INPUT", "SELECT", "TEXTAREA"];
addEventListener("keydown", function(ev, ele) {
if (ev.shiftKey || ev.ctrlKey || ev.altKey || tags.includes(ev.target.tagName)) return;
switch (ev.key.toUpperCase()) {
case "Z": // test
if (ele = document.querySelector(".CLASS")) ele.click();
break;
}
});
})();