title: jquery hide objects if object class doesn't contain a value
body: <p>The title might be a bit confusing, basically I'm trying to write up a script which will grab the selected values from a drop down form, and hide li's if its class does not contain the values from the drop down form.. if that makes sense?? Each li has multiple classes.. </p>
  
  <p>Here's what I've got so far (sorry if it's crude):</p>
  
  <p>FORM:</p>
  
  <pre><code>&lt;form action="" name="filter" id="filter" method="post"&gt;
          &lt;select name="bedrooms"&gt;
            &lt;option value=""&gt;- Select Bedrooms -&lt;/option&gt;
            &lt;option value="bed-1"&gt;1&lt;/option&gt;
            &lt;option value="bed-2"&gt;2&lt;/option&gt;
            &lt;option value="bed-3"&gt;3&lt;/option&gt;
            &lt;option value="bed-4"&gt;4&lt;/option&gt;
            &lt;option value="bed-5"&gt;5&lt;/option&gt;
          &lt;/select&gt;
          &lt;select name="bathrooms"&gt;
            &lt;option value=""&gt;- Select Bathrooms -&lt;/option&gt;
            &lt;option value="bath-1"&gt;1&lt;/option&gt;
            &lt;option value="bath-2"&gt;2&lt;/option&gt;
            &lt;option value="bath-3"&gt;3&lt;/option&gt;
            &lt;option value="bath-4"&gt;4&lt;/option&gt;
            &lt;option value="bath-5"&gt;5&lt;/option&gt;
          &lt;/select&gt;
          &lt;select name="frontage"&gt;
            &lt;option value=""&gt;- Select Frontage Size -&lt;/option&gt;
            &lt;option value="frontage-100"&gt;100&lt;/option&gt;
            &lt;option value="frontage-200"&gt;200&lt;/option&gt;
            &lt;option value="frontage-300"&gt;300&lt;/option&gt;
            &lt;option value="frontage-400"&gt;400&lt;/option&gt;
            &lt;option value="frontage-500"&gt;500&lt;/option&gt;
          &lt;/select&gt;
          &lt;input type="submit" name="filter-submit" id="filter-submit" value="Go" /&gt;
        &lt;/form&gt;
  </code></pre>
  
  <p>JQuery:</p>
  
  <pre><code>$("#filter-submit").click(function() {
  
            var foo = [];
            $("#filter :selected").each(function(i, value){
              foo[i] = $(value).val();
            });
            if (foo) {
              $.each(foo, function(index, value){
                if (value) {
                  //hide other objects based on "value"
                  //$("#portfolio li").hasClass();
              };
              });
            };
  
          return false;
          });
  </code></pre>
  
  <p>Ok so where I'm stuck is how to hide all "#portfolio li"'s which don't have the class which is outputted as "value". I thought I could use hasClass but not sure how to reverse it.. if that makes sense? Any help would be appreciated :)</p>