vendredi 28 février 2020

How do I set an interval, clear it, the reset the interval with the same exact ID

So basically I would like something like this

Inter = setInterval(Function, 1000);
clearInerval(Inter);
Inter = setInterval(Function, 1000);

For some reason something similar won't work for me, I'd post it all but I have no comments and no sense of organization. Is this supposed to work, or is their something I am missing?

Edit : Okay so I'll try to better explain this. So basically, I have an interval set, and a function to clear said interval. I need these to reset after every input, so the clearInterval has to recognize an interval with the same ID as it began with, so I need to basically re-use the ID, but for some reason it doesn't work. Hopefully thast madness made semi sense




Aucun commentaire:

Enregistrer un commentaire