-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtic_tac_toe.html
78 lines (73 loc) · 2.46 KB
/
tic_tac_toe.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<html>
<head>
<title>Tic tac toe</title>
<link rel="stylesheet" type="text/css" href="tic_tac_toe.css">
</head>
<body>
<div id="parent">
<h1>Tic tac toe</h1>
<form method="post">
<div>
<label for="name">Name:</label>
<input type="text" id="name" name="user_name">
<button type="submit">Submit</button>
</div>
</form>
<p id="player" class="hidden">X</p>
<table>
<tr>
<td>
<button type="button" onclick="handleClick('00')" id='00' class="square"> </button>
</td>
<td>
<button type="button" onclick="handleClick('01')" id='01' class="square"> </button>
</td>
<td>
<button type="button" onclick="handleClick('02')" id='02' class="square"> </button>
</td>
</tr>
<tr>
<td>
<button type="button" onclick="handleClick('10')" id='10' class="square"> </button>
</td>
<td>
<button type="button" onclick="handleClick('11')" id='11' class="square"> </button>
</td>
<td>
<button type="button" onclick="handleClick('12')" id='12' class="square"> </button>
</td>
</tr>
<tr>
<td>
<button type="button" onclick="handleClick('20')" id='20' class="square"> </button>
</td>
<td>
<button type="button" onclick="handleClick('21')" id='21' class="square"> </button>
</td>
<td>
<button type="button" onclick="handleClick('22')" id='22' class="square"> </button>
</td>
</tr>
</table>
<div class="flex-container">
<table id="results">
<caption>Results</caption>
<tr>
<th>X</th>
<th>O</th>
</tr>
<tr>
<td id="X_score">0</td>
<td id="O_score">0</td>
</tr>
</table>
<div id="result"></div>
</div>
</div>
<script src="/socket.io/socket.io.js"></script>
<script src="tic_tac_toe.js"></script>
<script>
io()
</script>
</body>
</html>