title: How to create a minesweeper board in javascript?
body: <p>I am using div elements to create minesweeper board (8 x 8 or whatever). I used 2 for loops to create the board of divs</p>
  
  <pre><code>window.onload = function () {
      var container = document.getElementById('container');
      for (var i = 0; i &lt; 8; i++) {
          for (var j = 0; j &lt; 8; j++) {
              var elem = document.createElement('div');
              container.appendChild(elem);
              elem.className = 'myclass';
          }
          var breaker = document.createElement('div');
          container.appendChild(breaker);
          breaker.className = 'clear';
      }
  }
  </code></pre>
  
  <p>Everything is nicely displayed but i can't figure out how to track the position of every tile (div), like a (x,y) coordinate system, so later i can do the game logic based on these coordinates. 
  So how can i map this grid system?</p>