title: filter rows with dropdown using jQuery
body: <p>I'm having a heck of a time getting this to work.  Should be simple, but every route I've tried has not worked.  Here's the jQuery I'm using now:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function () {
  
          //filter list by year
          $(function () {
              $("#ddYear").change(function (evt) {
                  var year = $("#ddYear").val();
  
                  $('tr').show();
  
                  $("td[id^='AccessRequestID']").each(function () {
                      alert("Checking " + this.val);
                      if ($(this).attr("class") == ".AR_" + year) {
                          alert("Hiding " + this.val);
                          $(this).parent().hide();
                      }
                  });
              });
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>And here's the table I'm trying to filter:</p>
  
  <pre><code>&lt;div class="index-header"&gt;Select a Year to View: &lt;%:Html.DropDownList("ddYear", Model.YearList, null %&gt;&lt;/div&gt;
  
  &lt;table id="arTable"&gt;
      &lt;tr&gt;
          &lt;th&gt;
              Year
          &lt;/th&gt;
          &lt;th&gt;
              Version
          &lt;/th&gt;
          &lt;th&gt;
              Name
          &lt;/th&gt;
  
      &lt;/tr&gt;
  
      &lt;% foreach (var item in Model.AccessRequests) { %&gt;
  
          &lt;tr class="clickable"&gt;
              &lt;td id="AccessRequestID&lt;%=item.Access_Request_ID%&gt;" class="&lt;%:string.Format("AR_{0}", item.RECORD_YEAR) %&gt;"&gt;
                  &lt;%: Html.DisplayFor(modelItem =&gt; item.RECORD_YEAR) %&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;%: Html.DisplayFor(modelItem =&gt; item.VERSION_NO) %&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;%: Html.DisplayFor(modelItem =&gt; item.EMPLOYEE_NAME) %&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
  
      &lt;% } %&gt;
  
  &lt;/table&gt;  
  </code></pre>
  
  <p>I initially tried doing something like this:</p>
  
  <pre><code>$("td[id^='AccessRequestID']").parent().hide().filter('.AR_' + year).show();
  </code></pre>
  
  <p>and while that filtered the rows out great, it didn't unfilter them back in when it should have.  So I tried adding <code>$("td[id^='AccessRequestID']").parent().show;</code> to reset it first, but that didn't do a thing.  (I also tried it with <code>.each()</code>, as you can see in my last try).  Any advice or help is much appreciated!</p>