Reputation: 138
I'm trying to use a loop (seen below) and want to change one character in an ID used throughout the loop. This would let me check all of the radio boxes in one loop without rewriting and adding the score up.
function scoreCalculationP1() {
var score = 0;
for (var i = 0; i <7; i++){
if (scanP1("rb_correctP1[NEED characters a-f to change here in ID for iterations 1-6]") === true){
score++;
}
}
return score;
}
function scanP1(id){
if (getChecked(id) === true){
return true;
}else {
return false;
}
}
Upvotes: 0
Views: 29