Created
April 30, 2020 13:41
-
-
Save JedBeom/70ab7c2b823940fb4b8e0fec4a6b47fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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