Skip to content

Commit

Permalink
JS 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
yermyerm committed Aug 12, 2023
1 parent e251591 commit d0aaf7c
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions java.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
const hzk = document.querySelector("#hzk img");
const reo = document.querySelector("#reo img");
const ysk = document.querySelector("#ysk img");
const asn = document.querySelector("#asn img");
const akn = document.querySelector("#akn img");

const lynch = [hzk, reo, ysk, asn, akn];

function dontTouch() {
alert("Don't touch");
function dontTouch(event) {
const lynch = ["HAZUKI", "REO", "YUSUKE", "ASANAO", "AKINORI"];
if (lynch.includes(event.srcElement.alt)) {
alert("Don't touch!");
}
}

hzk.addEventListener("click", dontTouch);
reo.addEventListener("click", dontTouch);
ysk.addEventListener("click", dontTouch);
asn.addEventListener("click", dontTouch);
akn.addEventListener("click", dontTouch);
addEventListener("click", dontTouch);

0 comments on commit d0aaf7c

Please sign in to comment.