Making a JavaScript game for a school assignment and I'm in need of some help.
I've got a 5x5 grid of radio buttons, a start button and a table with a span inside to display points. Upon clicking the start button, the variable 'playing' becomes true and a random radio is selected. if a player clicks the selected radio, the points variable is +1 and another random radio is selected.
So far I've managed to get the random radio select functions to work however I'm not really sure how to go about the rest. Not too sure how to check if a player clicks on the right radio button.
function SelectRadio(){
var array = document.getElementsByName('radio'); //Selects all the radio buttons.
var randomNumber=Math.floor(Math.random()*25)+1; // Selects a random number.
array[randomNumber-1].checked = true; //Selects a random from the array.
}