function injectTable() {
  var count = 0;
  var table = document.getElementById('grid');
  for (var y = 0; y < HEIGHT; y++) {
    var tr = document.createElement('tr');
    for (var x = 0; x < WIDTH; x++) {
      count++;
      var td = document.createElement('td');
      td.id = x + '_' + y;
      td.className = ((x + y) % 2) ? 'even' : 'odd';
      tr.appendChild(td);
    }
    table.appendChild(tr);
  }
}
// Create the DOM for the playing board.  Only done one.
Create the DOM for the playing board.  Only done one.
Create the DOM for the playing board . Only done one .
function injectTable() {
  var count = 0;
  var table = document.getElementById('grid');
  for (var y = 0; y < HEIGHT; y++) {
    var tr = document.createElement('tr');
    for (var x = 0; x < WIDTH; x++) {
      count++;
      var td = document.createElement('td');
      td.id = x + '_' + y;
      td.className = ((x + y) % 2) ? 'even' : 'odd';
      tr.appendChild(td);
    }
    table.appendChild(tr);
  }
}
function injectTable ( ) { var count = 0 ; var table = document . getElementById ( 'grid' ) ; for ( var y = 0 ; y < HEIGHT ; y ++ ) { var tr = document . createElement ( 'tr' ) ; for ( var x = 0 ; x < WIDTH ; x ++ ) { count ++ ; var td = document . createElement ( 'td' ) ; td . id = x + '_' + y ; td . className = ( ( x + y ) % 2 ) ? 'even' : 'odd' ; tr . appendChild ( td ) ; } table . appendChild ( tr ) ; } }
Create the DOM for the playing board.
Create the DOM for the playing board .