I am having the following logic in my code. When someone clicks a button on a button, I increment a score counter by one. I want to print this value in the html side, at the very next second. What are my optios? I have tried the following(score is a div in the html side and score the global counter) with no result:
document.getElementById("score").innerHTML+=score;
var tmpscore = document.getElementById("score");
tmpscore.appendChild(score);
Any ideas?
1 Answer