small solver for

Small Javascript script to show you the right answer.
Code:
var go = false; var intV = 0; function getAnswer() { [].forEach.call(document.querySelectorAll('button[data-v-2]'), function(div) { var txt = div.textContent || div.innerText; if ( "" + txt.replace(/\s/g, '') == (document.querySelector("img[data-v-4]").alt).replace(/\s/g, '') ) { div.style.color = "red"; div.addEventListener("click", function(e) { div.style.color = "#66bb6a"; go = true; }, false); } }); } function startLoop() { if(intV > 0) clearInterval(intV); intV = setInterval( "work()", 1000 ); } function work() { if(go) { getAnswer(); go = false; } } getAnswer(); startLoop();