+ 1
ClearInterval()
can i use clearinterval like this https://code.sololearn.com/W9QkTTK49bVr/?ref=app
9 Answers
+ 2
prompt should not be inside the timer function.
+ 2
Niceđ code but when i click any number or click cancel in the prompt it keeps on saying "Hello"
+ 2
you gotta put that 'document.write("hello"); ' in else
+ 1
but its much easier to use var x like that
+ 1
i just created it as an example for set and clearinterval,,But thanks.. your profile is great
+ 1
If you like to use timer to print hello, clear timer to stop print
Check out this
https://code.sololearn.com/W956sToFPV12/?ref=app
+ 1
Then you to check x value make sure it's a number and also not zero( cancel return 0)
if(!isNaN(x) && x!==0)
Check the same code again
+ 1
but i think mine is easier !! but you're a big coder i accept itđđ
0
No need to use setInterval and clearInterval function. Just call startandstop() directly.
https://code.sololearn.com/W42IpSo8k8iZ/?ref=app