0
Where is the error in this code?
4 Answers
+ 2
1) declare your variables outside the function to make them global.
2) use "clearInterval (...)" to stop function calls
+ 1
Try to write var av,bv,cv and dv before the functions, but its optional
Then, try
document.getElementById('abcd').innerHTML = av;
Instead of
var a = .....
+ 1
Because when you write a variable in which you define it's innerHTML, you will get 2 value loops running at the same time like this :
a = 0
av = 5
a = 1
av = 6
a = 3
av = 7
This is what happens when you make it a variable
P.s. sorry if I am not explaining this very understandable because of my poor english skills, but I've only had 2 years of english lessons.
0
Thanks!