title: Filtering on string starting value
body: <p>I have a search bar to show the rows with a cell that contains a specific value, but I only want the ones that start with that value, only if they start with it, not if they contain it in the middle of the string.</p>
  
  <p>This is what I have:</p>
  
  <pre><code>var $rows = $('#tableID tbody tr');
  
  $('#search').keyup(function() {
      var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase();
  
      $rows.show().filter(function() {
          var text = $('.filterClass', this).text().replace(/\s+/g, ' ').toLowerCase();
          return !~text.indexOf(val);
      }).hide();
  });
  </code></pre>