Skip to content

Instantly share code, notes, and snippets.

@Sammykhaleel
Created August 8, 2020 18:49
Show Gist options
  • Save Sammykhaleel/1bc11deec7467512c5e177ebaedc0015 to your computer and use it in GitHub Desktop.
Save Sammykhaleel/1bc11deec7467512c5e177ebaedc0015 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>repl.it</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body onload="startGame();">
<h1>Tic tac toe - Javascript ver. 1</h1>
<div id="message">message goes here </div>
<table border="1">
<tr>
<td class="Square" id="s1" onClick="nextMove(this)"></td>
<td class="Square" id="s2" onClick="nextMove(this)"></td>
<td class="Square" id="s3" onClick="nextMove(this)"></td>
</tr>
<tr>
<td class="Square" id="s4" onClick="nextMove(this)"></td>
<td class="Square" id="s5" onClick="nextMove(this)"></td>
<td class="Square" id="s6" onClick="nextMove(this)"></td>
</tr>
<tr>
<td class="Square" id="s7" onClick="nextMove(this)"></td>
<td class="Square" id="s8" onClick="nextMove(this)"></td>
<td class="Square" id="s9" onClick="nextMove(this)"></td>
</tr>
</table>
<a href="javascript:startGame();" id="restart">Start Game!</a>
<script src="script.js">
</script>
</body>
</html>
@import url('https://fonts.googleapis.com/css?family=Archivo+Black');
body{
width: 250px;
margin: auto;
font-family: 'Archivo Black', sans-serif;
background-color: rgb(246, 247, 242);
}
table{
border-width: 1px;
}
h1{
border-bottom: 1px solid black;
font-size: 20px;
}
#message{
font-size: 15px;
color: green;
padding-bottom: 20px;
}
#restart{
color: red;
padding-top: 20px;
}
.Square{
height: 80px;
width: 80px;
font-size: 40px;
text-align: center;
font-weight: bold;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment