title: restart Jquery setInterval and reset all vars
body: <p>i have some radio buttons with class = active</p>
  
  <pre><code>  &lt;div id="radioset1"&gt;
     &lt;input type="radio" class="active" id="radio1" name="radio" /&gt;
     &lt;input type="radio" class="active" id="radio2" name="radio" /&gt;
     &lt;input type="radio" class="active" id="radio3" name="radio" /&gt;
    &lt;/div&gt;
    &lt;div id="counter_up"&gt;xy&lt;/div&gt;
  </code></pre>
  
  <p>I want to add a timer to the div "counter_up" to show when was the last change of the radiobutton.</p>
  
  <p>therefore i added some jquery code like this:</p>
  
  <pre><code>  $('.active').click(function() {
  
      clearInterval(myInterval);
      var counter = 0;
      var myInterval = setInterval(function() {
  
        ++counter;
        $('#counter_up').html('Aktiv seit ' + counter + ' Sekunden');
  
      },1000);
  
   });
  </code></pre>
  
  <p>my code is working, so when i click one of the radio buttons the first time everything works fine.</p>
  
  <p>the problem is, when i click another radio button, the var counter dont starts with 0.</p>
  
  <p>I tried to use delete var and clearInterval, but it doesnt work. 
  can somebody help?</p>