I'm trying to learn Javascript before I learn jQuery so I can get the foundation down before moving up.
To learn, I've made a simple guessing game that works in Chrome & Safari, but not Firefox. (I guess that is why people use jQuery!).
I adjusted the code based on this answer. But it is still not working in Firefox. Here's the relevant code. Any ideas?
function reportAnswer(e) {
if(!e) e = window.event;
questionNumber++;
document.getElementById("myCount").innerHTML = (questionNumber + 1);
var x = e.target || e.srcElement;
checkAnswer();
}
function checkAnswer() {
var thisAnswer = questionDatabase[currentQuestion].answer;
if(event.target.id == thisAnswer) {
document.getElementById("answer").innerHTML = ("YES! </br>" + questionDatabase[currentQuestion].photo);
score++;
}
else {
document.getElementById("answer").innerHTML = ("<img src=http://philly.barstoolsports.com/files/2012/11/family-feud-x2.png width='370' height='370'>");
}
}