title: javascript array indexOf not working
body: <p>trying to build a html minesweeper game im a pretty much beginner and im trying to get a onclick to check if that box is equal to the value of a bomb spot</p>
  
  <p>javascript i use to fill my "table" element ( with the id of "grid") giving each box/td an id 0-99</p>
  
  <pre><code>var gameBox = "";
  for ( var i = 0 ; i &lt; 10 ; i++ ) {
  
  gameBox += "&lt;tr&gt;";
  for ( var j = 0 ; j &lt; 10 ; j++ ) {
      var idValue = i * 10 + j;
      gameBox += "&lt;td class = 'box' id = '" + idValue + "' onclick = 'process(this);' &gt;&lt;/td&gt;";
  }
  gameBox += "&lt;/tr&gt;";
  }
  document.getElementById("grid").innerHTML = gameBox;
  </code></pre>
  
  <p>heres the bomb array intializer giving it a length of 10</p>
  
  <pre><code>var bomb = [];
  
  for ( var i = 0 ; i &lt; 10 ; i++ ) {
  bomb[i] = 0;
  }
  </code></pre>
  
  <p>after user clicks start button (heres the html:)</p>
  
  <pre><code>            &lt;input type="button" class="MtopSmall" value="start!" name = "startButton" onclick = "start();" &gt;
  </code></pre>
  
  <p>they trigger the start function which assigns 10 different random numbers 0-99</p>
  
  <pre><code>function start() {
  
  for ( var i in bomb ) {
  
      var number = Math.floor( Math.random() * 100 );
          if( bomb.indexOf(number) &gt;= 0 ){
              reassign(i);
          } else {
              bomb[i] = number;
          }   
      }
  
  console.log(bomb);
  }
  
  function reassign(i) {
  
  var number = Math.floor( Math.random() * 100 );
      if( bomb.indexOf(number) &gt;=0)
      {
              reassign(i);
          } else {
              bomb[i] = number;
          }       
  }
  </code></pre>
  
  <p>then when they click a box (td) it triggers the process function</p>
  
  <pre><code>function process(clicked) {
  //change box look
  clicked.style.backgroundColor = "#ffffff";
  clicked.style.border = "1px solid black"; 
  bombCheck(clicked);
  }
  </code></pre>
  
  <p>which triggers the bombCheck()</p>
  
  <pre><code>bombCheck(event)
  var boxNum = event.id;
  function bombCheck(event) {
  if ( bomb.indexOf(boxNum) &gt;=0 ) {
      event.innerHTML = "B";
       alert("you clicked a bomb");
      }
  }
  </code></pre>
  
  <p>the problem is the final indexof (the one in bombcheck) always returns -1 weather or not its a bomb (and i check which r bombs with console.log) as you can see i used a similar indexOf check earlier in the same script and it works just fine plz help me</p>