How would I toggle the state of a setInterval function in jQuery?
<p>I want to be able to click a an element with an id of pause to start a count of the elements in a time object and if I re click the pause it will stop it and reclick start it exactly like the toggle feature in JQuery but with a setInteval function how would I go about doing this?</p>

<pre><code>$("#pause").click(function(ffe) {
  if(on == true) {
    on = false 
    alert("on");
  }
  else {
    on = true;
    alert("off");
  }
  if(on == false) {
    setInterval(function() {
      $("#timet ul").append("&lt;li&gt;" + $("#time ul")
                    .children('li').length +"&lt;/li&gt;");

    }, 100);
  }
  else {

    alert("Error");
  }
});
</code></pre>
