title: jQuery filter select options by text input
body: <p>I have a select list where I want to filter the options from a text input.</p>
  
  <p>I wrote this jQuery code:</p>
  
  <pre><code>$('#NotPublishedSelectFilter').keyup(function () {
      console.log("NotPublishedSelectFilter keyup");
      var filterText = $(this).val();
      console.log("filterText: " + filterText);
      var allOptions = $('#NotPublishedSelect').find('option');
      allOptions.each(function (i, e) {
          console.log(i);
          if (e.text().indexOf(filterText) != -1) {
              e.show();
              console.log("show");
          } else {
              e.hide();
              console.log("hide");
          }
      });
  });
  </code></pre>
  
  <p>However I get the error <code>Uncaught TypeError: e.text is not a function</code>. I get into the each loop so there should be some option for e.</p>
  
  <p>What am I doing wrong? </p>