I have this HTML -
<div class="qa">
<div class="questions"></div>
<div class="answers">
<div class="answer">
<input type="radio" name="answer" value="Correct" id="Correct" /><label for="Correct"> Answer 1 </label>
</div>
<div class="answer">
<input type="radio" name="answer" value="Incorrect" id="Incorrect" /><label for="Incorrect"> Answer 2 </label>
</div>
</div>
And my JavaScript look something like this -
var questions = [ {
"q": "When was Project Launched?",
"a": {"Correct": "That's Right!","Incorrect": "Nope, Project was launched in 2016" },
"Option1": "2016",
"Option2": "2017"
},
What I would like is the answers to pull dynamically to the radio button label in the HTML. So I really need to be able to put the "Option1" and "Option2" IDs into the <label for="Correct">
space instead of just the static "Answer1" "Answer2" text.
Is it possible?
Thanks,