title: I am trying to parse two JSON objects retrieved from text fields in my HTML to retrieve values from the JSON file
body: <p>Like the title says, a user inputs into two fields on my HTML file. I am trying to take these two fields, assign them a variable in JS and depending on what they type in, a result is given from a JSON file. Am I missing something? I can get it to work if I am just using one user-inputted value, but I cannot seem to make two values work properly. Here is the link to the JSON file:<a href="https://facweb.cdm.depaul.edu/sjost/cities.js" rel="nofollow noreferrer">JSON File</a></p>
  <pre><code>function listCities() {
      var c = document.getElementById(&quot;country&quot;);
      var s = document.getElementById(&quot;subcountry&quot;);
      var answer = document.getElementById(&quot;textarea1&quot;);
      var citiesArray = JSON.parse(data);
      var output = &quot;&quot;
      for(obj of citiesArray) {
          if(obj.country == c.value &amp;&amp; obj.subcounty == s.value) {
              output += `${obj.name}\n`;
          }
      }
      answer.value = output;
  }
  </code></pre>