我正在尝试制作井字游戏。我使用的是图像而不是 Xs 和 Os,因此在单击 td 时需要用图像填充它。我试过这个:
function makeDuck(place){
//this is just so I know the other methods work
alert("duck");
//This is the line I need help with
window.location.write('<img src="smallDuck.jpg" width="70" height="70"/>');
squares[place] = 1;
}
function makeBeaver(place){
//this is just so I know the other methods work
alert("beaver");
//This is the line I need help with
document.zero.write('<img src="smallBeaver.jpg" width="80" height="80"/>');
squares[place] = 2;
}