I'm trying to create a quiz and I'd like to know how I create a function to store responses using javascript. Can I store in an array and then make the comparison if they are right?
<!DOCTYPE html>
<html>
<head>
<title>Quiz</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<script type="text/javascript" src="script.js"></script>
<body>
<form class="formulario">
<div class="question">
<p>Quem foi o campeão brasileiro de 2016?</p>
<input type="radio" name="choice" value="1" id="op1">Palmeiras<br>
<input type="radio" name="choice" value="4" id="op2">Flamengo<br>
<input type="radio" name="choice" value="2" id="op3">Grêmio<br>
<input type="radio" name="choice" value="3" id="op4">Cruzeiro<br><br>
<input type="submit" value="Enviar">
</div>
</form>
</body>
</html>