zashii-1434

Stats of My Life(おいしい人生を味わうために、コツコツとチャレンジしたことを書くブログ)

JavaScript-○×ゲーム

レイアウトがchromeだと崩れるのはなぜだろう。

トラブル対応も勉強ですね。

 

<!DOCTYPE html>
<html>
<head>
<style>
.cell {
widows: 100px;height: 100px;
font-size: 60pt;
text-align: center;
}
</style>

<script>
var count = 0;
function clickMe(e) {
if (count++ % 2 == 0) {
e.textContent = "○";
} else {
e.textContent = "×";
}
}
</script>
</head>
<body>
<table border = "1">
<tr>
<td class="cell" onclick="clickMe(this)";></td>
<td class="cell" onclick="clickMe(this)";></td>
<td class="cell" onclick="clickMe(this)";></td>
</tr>
<tr>
<td class="cell" onclick="clickMe(this)";></td>
<td class="cell" onclick="clickMe(this)";></td>
<td class="cell" onclick="clickMe(this)";></td>
</tr>
<tr>
<td class="cell" onclick="clickMe(this)";></td>
<td class="cell" onclick="clickMe(this)";></td>
<td class="cell" onclick="clickMe(this)";></td>
</tr>
</table>
</body>
</html>