title: jQuery keyup event increase-"function" will set to 0
body: <p>I've three input fields to "search" a JSON tree. If all three fields are filled and correct get the data from next JSON level.</p>
  
  <p>I count up a number through the keyup-event to get next data of a JSON tree. But every time all three fields are filled the counter will reseted.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;h1&gt;sein&lt;/h1&gt;
  &lt;form&gt;
      &lt;input type="text" id=simple_present placeholder="simple present"&gt;
      &lt;input type="text" id=simple_past placeholder="simple past"&gt;
      &lt;input type="text" id=past_participle placeholder="past participle"&gt;
  &lt;/form&gt;
  &lt;div class="answer"&gt;Enter: be - was - been&lt;/div&gt;
  </code></pre>
  
  <p><strong>JS</strong></p>
  
  <pre><code>$('input').on('keyup', function() {
      var count = 0;
  
      if (this.value === json.verbs.irregular[count++][this.id]) {
          $(this).prop('disabled', true).next().focus();
      }
  
      if ($('input:not(:disabled)').length === 0) {
          $('input').val('').prop('disabled', false).first().focus();
          $('h1').text(json.verbs.irregular[count++].infinitiv);
          alert(count);
      }
  });
  </code></pre>
  
  <p>Perhaps the variable will set to 0 on each key-event? But I cant set it outside the <code>keyup</code>-event!</p>
  
  <p>Here is a <a href="http://jsfiddle.net/ARTsinn/NnAMu/4/" rel="nofollow">demonstration</a> of what I've done so far.</p>
  
  <p>Just type:</p>
  
  <ol>
  <li>be</li>
  <li>was</li>
  <li>been</li>
  </ol>
  
  <p>Any ideas?</p>