title: How to use in jQuery :not and hasClass() to get a specific element without a class
body: <p>I have this line of code:</p>
  
  <pre><code>$('#sitesAccordion .groupOfSites').click(function() {
      var lastOpenSite = $(this).siblings().hasClass(':not(.closedTab)');
      console.log(lastOpenSite);
  });
  </code></pre>
  
  <p>I get "false" instead of getting one of the other elements (assuming that there is one - and there must be). I guess the problem is with:</p>
  
  <pre><code>.hasClass(':not(.closedTab)');
  </code></pre>
  
  <p>What is the problem?</p>
  
  <p>My purpose is to create my own accordion (without using jQuery UI)</p>
  
  <p>and I am trying to write it like this:</p>
  
  <pre><code>$('#sitesAccordion .groupOfSites').click(function() {
  
      //Get the last opened tab
      var lastOpenSite = $(this).siblings().hasClass(':not(.closedTab)');
  
      //Close last opened tab and add class
      lastOpenSite.hide().toggleClass('closedTab');
  
      //Open the current Tab
      $(this).children('.accordionContent').toggle('fast');
  
      // remove class from open tab
      $(this).toggleClass('closedTab');
  
  
  });
  </code></pre>
  
  <p>Is this the best way?
  thanks,
  Alon</p>