Skip to content

Instantly share code, notes, and snippets.

@gmelodie
Created January 30, 2019 13:02
Show Gist options
  • Save gmelodie/714190567dda5072d11a81059f7ebab6 to your computer and use it in GitHub Desktop.
Save gmelodie/714190567dda5072d11a81059f7ebab6 to your computer and use it in GitHub Desktop.
Tic-tac-toe hiding feature v3
<html>
<script type="text/javascript">
function computePlay(buttonId) {
let selected = document.getElementById(buttonId);
selected.style.display = 'none';
}
</script>
<h1> Tic-tac-toe </h1>
<form id='board'>
<input type="radio" name="play" onclick="computePlay(11)" id="11">
<input type="radio" name="play" onclick="computePlay(12)" id="12">
<input type="radio" name="play" onclick="computePlay(13)" id="13">
<br>
<input type="radio" name="play" onclick="computePlay(21)" id="21">
<input type="radio" name="play" onclick="computePlay(22)" id="22">
<input type="radio" name="play" onclick="computePlay(23)" id="23">
<br>
<input type="radio" name="play" onclick="computePlay(31)" id="31">
<input type="radio" name="play" onclick="computePlay(32)" id="32">
<input type="radio" name="play" onclick="computePlay(33)" id="33">
<br>
</form>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment