title: Is there any way to kill a setInterval loop through an Onclick button
body: <p>So, I got an infinite loop to work in this function using setInterval attached to an onClick. Problem is, I can't stop it using clearInterval in an onClick. I think this is because when I attach a clearInterval to an onClick, it kills a specific interval and not the function altogether. Is there anything I can do to <em>kill all intervals</em> through an onClick?</p>
  
  <p>Here's my <a href="http://lucas.cis.temple.edu/~c10520124/lab6/gol.js" rel="noreferrer">.js file</a> and the calls I'm making are </p>
  
  <pre><code>input type="button" value="generate" onClick="generation();
  
  input type="button" value="Infinite Loop!" onclick="setInterval('generation()',1000);"
  
  input type="button" value="Reset" onclick="clearInterval(generation(),80;" // This one here is giving me trouble.
  </code></pre>