I am trying to create a rock paper scissors game.
The user choice must populate as a variable using a form with a radio button.
When I click on submit I would like to have the radio button checked to be passed as a variable. How can I get the users choice?
<div id="global">
<h1>Jeu Pierre Feuille Ciseau</h1>
<h3>Choisissez Pierre, Feuille ou Ciseaux:</h3>
<div>
<input type="radio" id="pierre" name="game" value="pierre" checked>
<label for="pierre">Pierre</label>
</div>
<div>
<input type="radio" id="feuille" name="game" value="feuille">
<label for="pierre">Feuille</label>
</div>
<div>
<input type="radio" id="ciseaux" name="game" value="ciseaux">
<label for="pierre">Ciseaux</label>
</div>
<button id="submit">Submit</button>
</div>
<script type="text/javascript">
window.document.getElementById("submit").onclick = function(){
}
</script>