as the title says i need to create a game but my problem is that I don't know how to read the radio buttons using javascript and based on the options, it generates a scenario with the game mode with the difficulty the player picks. I am using one text input for the nickname and 2 fieldsets like this one for the player to select the type of the game and difficulty.
<fieldset>
<legend>Dificuldade:</legend>
<input type="radio" name="dificuldade" value="easy"> easy </input>
<input type="radio" name="dificuldade" value="medium"> medium </input>
<input type="radio" name="dificuldade" value="hard"> hard </input>
</fieldset>