Solver for JavaScript guessing game

11/09/2016 11:31 Devsome#1
Hello Elitepvpers.com

small solver for [Only registered and activated users can see links. Click Here To Register...] , yeah you can check the HTML code for the right answer.

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();