ItriedtousegetElementeByIdbutitisnotworking.
HTMLQuiz
<divclass="buttons"> <!--Creating four button element for four options-->
<button id="btn0"><span id="choice0"></span></button>
<button id="btn1"><span id="choice1"></span></button>
<button id="btn2"><span id="choice2"></span></button>
<button id="btn3"><span id="choice3"></span></button>
</div>
function quiz(){
document.getElementById("choice0").value = array[index][1];
document.getElementById("choice1").value = array[index][2];
document.getElementById("choice2").value = array[index][3];
document.getElementById("choice3").value = array[index][4];
}
var array = [ ["Who discovered Brazil?", "Cabral", "Paes", "Little Boy", "Lula" ... ]
EDIT: I have now logged into the console log, it looks like the error is this: Uncaught TypeError: Can not read property '1' of undefined in array index .