I almost have this working but one thing I cant quite figure out: What I'm trying to do is create a radio button list on the fly. However, when I do this it creates a radio box each time so all my answers can be selected. How can I create one input, that has 4 options so that I can only select one instead of them all?
function questionAnswers() {
let arr = Object.values(questionList[i].answers)
for (var a in arr){
let checkbox = document.createElement('input')
let label = document.createElement('label')
label.appendChild(document.createTextNode(arr[a]))
checkbox.type = 'radio';
answerSection.appendChild(checkbox);
answerSection.appendChild(label)
}
}