title: How to get jQuery live search in javascript array more accurate?
body: <p>I want to make live search using jQuery AJAX and PHP, with one input textbox as the filter of the data. So on the background I have JSON data like this:</p>
  
  <pre><code>[
      ["1","Your Name 1","button_field"],
      ["2","Your Name 2","button_field"],
      ["3","Your Name 3","button_field"]
  ]
  </code></pre>
  
  <p>This is my jQuery code, for the live search when user start typing on the textbox:</p>
  
  <pre><code>$('input[name="search_value"]').on('keydown', function() {
      $.ajax({
          url: 'http://localhost/myapp/ajax/get',
          type: 'GET',
          dataType: 'json',
          success: function(data) {
              var search = $('input[name="search_value"]').val();
              var output = '';
  
              for (i = 0; i &lt; data.length; i++) {
                  if (($.inArray(search, data[i]) !== -1) || (search === '')) {
                      output += '&lt;tr&gt;';
  
                      for (j = 0; j &lt; data[i].length; j++) {
                          output += '&lt;td&gt;' + data[i][j] + '&lt;/td&gt;';
                      }
  
                      output += '&lt;/tr&gt;';
                  }
              }
  
              $('.table-data &gt; table &gt; tbody').html(output);
          }
      });
  });
  </code></pre>
  
  <p>I try to using search, by typing <code>Your Name 2</code>, and it works. But when I try to typing <code>your name 2</code> (no uppercase for each first word) and try to typing <code>our name 2</code> (with missing <code>y</code>), the result is not shown.</p>
  
  <p>And my question is : How to make the search results is ignoring the uppercase (make case insensitive) and start showing the data even the search value is incomplete ? Thanks for all your answers :)</p>