title: How to check the toggled-hidden state with jQuery
body: <p>When my ajax-call is (non-)successfull, I toggle the hidden state from  one of my three alert-div's.</p>
  
  <pre><code>$('#alert-success).toggle(':hidden');
  </code></pre>
  
  <p>When, after a first save, I make some more changes and save again I want the #alert-success to be reset to normal state (hidden) so it will appear again after a successfull ajax-call.</p>
  
  <p>What happens now is that my #alert-success just disappears when submitting because of the .toggle(':hidden').</p>
  
  <p>How can I do a reset? I tried this without success:</p>
  
  <pre><code>function resetAlerts() {
      $(document).each(function() {
          if ($('.alert').not(':hidden')) {
              $('.alert').toggle(':hidden');
          }
      })
  }
  </code></pre>
  
  <p>So I was thinking that this .not(':hidden') only works on values loaded in the DOM and not changed afterwards. Can it be?</p>