Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2
Use clearInterval() method: var f = null; function t(){ z=1 document.getElementById("v").disabled = true; if (f===null) f=setInterval(q, 10); } function stop(){ document.getElementById("v").disabled = false; z=0; if (f!==null) clearInterval(f); f = null; } [edited to correct a little mistake]
12th Jan 2018, 1:51 PM
visph
visph - avatar