+ 1
What is wrong in this code?
3 Answers
+ 1
The *break* keyword is used to stop a loop (for, while, ...). In your case you are setting an interval - not a loop. To stop an interval first you have to assign the interval to a variable:
var interval = setInterval(a, 40);
Only then you can stop that interval with:
clearInterval(interval);
+ 1
Also i don't understand why you want to return there. It achieves nothing. Are you sure you don't want to move the document.write below the return statement.
0
Thanks all I underestood