ClearInterval() and SetInterval()
<p>So in my javascript code, there is a part where if the user clicks on the checkbox I need to change the time delay used by <code>setInterval()</code>. At the moment, I used the <code>onchange</code> handler on the checkbox. Whenever the checkbox is changed, I call <code>clearInterval()</code> and <code>setInterval()</code>. I have the interval id as a global variable. Now if the user changes the checkbox before i have made my call to <code>clearInterval()</code> I expected there to be some issues, but nothing happened. Is there a better way to do this or is this way considered standard? Is there a way to check if there is an <code>interval</code> in existence?</p>

<p>PS.
I'm very new to Javascript, started it about 5 hours ago.</p>
