I've got a bunch of checkboxes defined as an array:
<input type="checkbox" value="1" id="courseinfo[]">Content
<input type="checkbox" value="2" id="courseinfo[]">Reputation
<input type="checkbox" value="3" id="courseinfo[]">Duration
<input type="checkbox" value="4" id="courseinfo[]">Career
<input type="checkbox" value="5" id="courseinfo[]">Recommended
<input type="checkbox" value="6" id="courseinfo[]">Interests
<input type="checkbox" value="7" id="courseinfo[]">Other
I am trying to see if the last one (value=7) is checked, I tried:
q2 = document.getElementById("courseinfo[6]").value;
That doesn't seem to work.
How can I access the 7th one in the array and then check if its been checked?
I want to use pure javascript.
q2 = document.getElementById(facilities[6]).value;"facilities[6]"?? doesn't seems id