Code:
alert(cell.img + ' g'); // will throw an error. // alert(cell.getElementsByTagName('img')[0] == img)
this.row[yCount].appendChild(cell[xCount]); // cell already points to the current cell. // this.row[yCount].appendChild(cell);
alert(this.row[yCount].cell[xCount] + ' walks'); // idem // alert(this.row[yCount].cell + ' walks');
count++;
xCount++;
}
tbody.appendChild(row); // you don't have a variable called row // tbody.appendChild(this.row[yCount]);