Skip to content

Instantly share code, notes, and snippets.

@JedBeom
Created April 30, 2020 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JedBeom/70ab7c2b823940fb4b8e0fec4a6b47fa to your computer and use it in GitHub Desktop.
Save JedBeom/70ab7c2b823940fb4b8e0fec4a6b47fa to your computer and use it in GitHub Desktop.
isStop = false
let words = document.querySelectorAll(".match-body.left .flip-card")
let meanings = document.querySelectorAll(".match-body.right .flip-card")
function clickAnswers() {
for(let i = 0; i < 4; i += 1) {
for(let j = 0; j < 4; j += 1) {
if (words[i].getAttribute("data-idx") === meanings[j].getAttribute("data-idx")) {
words[i].click()
meanings[j].click()
return
}
}
}
console.log("------ NO ANSWER!! ------")
}
let i = setInterval(function() {
clickAnswers()
if (isStop) {
clearInterval(i)
}
}, 1250)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment