That’s the code:
function pagechange(frompage, topage) {
var page = document.getElementById('formpage_' + frompage);
if (!page) return false;
page.style.visibility = 'hidden';
page.style.display = 'none';
page = document.getElementById('formpage_' + topage);
if (!page) return false;
page.style.display = 'block';
page.style.visibility = 'visible';
return true;
}
var currentShown = "";
function unhide(rad) {
var id = "answer" + rad.id.replace("-", "");
var answer = document.getElementById(id);
if (answer) {
var current = document.getElementById(currentShown);
if (current) current.className = "hidden";
currentShown = id;
answer.className = "unhidden";
}
}
var score = 0;
function scoreIncrement() {
score++;
document.getElementById("score").innerHTML = score;
}
Then here’s my website page with that code:
http://elearning.easy2dev.com/quiz_template_3.php
When John is clicked it should increment the score by 1 and then show answer boxes underneath, nothing happens but in JS Fiddle it works. It used to work but I seem to have broken it somehow.
If you would use FireFox with the FireBug extension, you would see this error:
Which refers to the following code: