title: Filter select options using jquery
body: <p>I have a select menu where the text for each option starts with a keyword (i.e. - "Nike Running Shoes"...Nike being the keyword).  I want to have a second static select that contains a list of keywords...and then be able to filter the second list options by the keyword selected.</p>
  
  <p>So, if user chose keyword "Nike", the second list would be filtered to only include options who test starts with "Nike".</p>
  
  <p>this is the jquery I've created so far...but its not working</p>
  
  <pre><code>jQuery -&gt;
  subjects = $('#subject_select').html()
  $('#keyword_select').change -&gt;
      keyword = $('#keyword_select :selected').text()
      options = $(subjects).filter("option[text^='#{keyword}']").html()
  
      if options
          $('#subject_select').html(options)
      else
          $('#subject_select').empty()
  </code></pre>
  
  <p>adding "alert options" produced "undefined".  The line I need help with is:</p>
  
  <pre><code> options = $(subjects).filter("option[text^='#{keyword}']").html()
  </code></pre>
  
  <p>This is an easy task when dealing with two models that are associated.  In my case they are not associated (which is why I am using static keywords).</p>