My file works just fine in the first round of loop when i try to rerun the function again. It shows the previous value of the previous loop when i try to use the value to match and after which it shows the correct value. If i run the function again and again, it keeps holding on to the value of the previous generated random value.
for (var i=0; i<9; i++)
  {
    var ranD = Math.floor(Math.random()*33);
    if (mathStar.indexOf(ranD)== -1) {
     mathStar.push(ranD);
     item[i].innerHTML = mathStar[i];
      }
      else {
        i--;
      }
      itemVal[i].value = mathStar[i];
  }
 
     
     
    