jeudi 28 décembre 2017

My else didn't work

I don't know why my else didn't work, it's my first time that actually happened and i check console log. This is my code:

setTimeout(function() {
  var b = 2;
  var d = 80000;
  if ("div[class='resultInfo resultLose']") {
    setTimeout(function() {
      var a = ($("input[name='_4']").val().replace(/\s+/g, ''));
      var c = a * b;
      $("input[name='_4']").val(c);
      $("input[value='Play!']").click();
    }, 1000);
  } else if ("div[class='resultInfo resultWin']") {
    setTimeout(function() {
      $("input[name='_4']").val(d);
      $("input[value='Play!']").click();
    }, 1000);
  }
}, 4500);

I try to: 1. delete the setTimeout in if 2. delete the " if ("div[class='resultInfo resultWin']") "

This only use first if even the elseif is true, I don't know what to do :/

Aucun commentaire:

Enregistrer un commentaire