title: Remove case sensitivity in a JS search
body: <p>I have a list on a page and a search bar that searches and filters the list as the user types. At the moment the input has to be all lowercase (which I've added myself). How can I remove all case sensitivity from the search string? For example if I search for <code>teST</code> the result for <code>Test</code> would still appear.</p>
  
  <pre class="lang-js prettyprint-override"><code>var list = $("table.ms-listviewtable");
  var listItems = $("table.ms-listviewtable tr:not(.ms-viewheadertr)"); 
  var input = $("input#filterInput");
  
  input.keyup(function() {
    listItems.each(function() {
      var text = $(this).text();
      var text = $(this).text().toLowerCase();
      if (text.indexOf(input.val()) != -1) {
        $(this).show();
      } else {
        $(this).hide();
      }
    });
  });
  </code></pre>