what im trying to write is a function that will be activated by a click that will run if the class name of the clicked element is correct. then change the class name to another state so it can not be run again until another part of the function reverts it. it will roughly look like this:
king1.addEventListener("click", turn);
function turn() {
if (this.className="nf") {
this.className="f"
...run more functions after
};
}
Aucun commentaire:
Enregistrer un commentaire