title: How to search in JSON file?
body: <p>How could I create a search form that will search for the entered term inside a JSON file?</p>
  
  <p>So if the search term is equal to a title inside the location object, it should return that object info. If there is no match, give the user feedback that there are no items found</p>
  
  <p>I created a search input: </p>
  
  <pre><code>    &lt;form action="" method="get"&gt;               
           &lt;input id="search" type="text" placeholder="Search term"&gt;
           &lt;input type="submit" class="button"&gt;
     &lt;/form&gt;
  </code></pre>
  
  <p>My JSON looks like this:</p>
  
  <pre><code>{
      "title":    "Locations",
      "locations":    [
          {
              "title":        "New York",
              "url":          "api/newyork.js"
          },{
              "title":        "Dubai",
              "url":          "api/dubai.js"
          },{
              "title":        "Netherlands",
              "url":          "api/netherlands.js"
          },{
              "title":        "Lanzarote",
              "url":          "api/lanzarote.js"
          },{
              "title":        "Italy",
              "url":          "api/italy.js"
          }
  
      ]
  }
  </code></pre>
  
  <p>Update:</p>
  
  <p>I came up with the following, using jQuery:</p>
  
  <pre><code>$("#search").change(function() { 
              var arrival = $(this).val();
  
              $.getJSON( "api/videoData.js")
              .done(function(data) {
                  // update your ui here
                  console.dir(data.pages);
                  var dataArr = data.pages;
  
                  // Iterate over each element in the array
                  for (var i = 0; i &lt; dataArr.length; i++){
                      // look for the entry with a matching `code` value
                      if (dataArr[i].title == arrival){
                          // we found it
                          console.log(dataArr[i].title);
                      } else {
                          console.log('Houston, we have a problem');
                      }
                  }
  
              }).fail(function(data) {
              // handle error here
                  console.log('no results found');
              });
  
          });
  </code></pre>
  
  <p>This is working, only it should be entered exactly as stored in the JSON. 
  So when you search for "Italy" and you use lowercase type, it will not find the object. Also it will not give any entries when you search for example: <code>ne</code>. I would like to get Netherlands and New York as search results.</p>