title: get data from dynamic key value in json
body: <p>The requirement is following:<br>
  I have to get the location field from page.</p>
  
  <pre><code>var input= global.input = document.getElementById("Location");
  </code></pre>
  
  <p>Get the neighborhood area from the json file based on input and show on the page.</p>
  
  <p>I have a json object and have to filter the data from the json object based on the key value (location)</p>
  
  <pre><code>var inputLocation=input.value;
  </code></pre>
  
  <p>In my javascript I am getting the error if I use dynamic the key.</p>
  
  <p>I am able to get the json array if I do this <code>data.Aspen</code> but i have to get the data from a text field and it can be different so if I call data.inputLocation... its coming undefined</p>
  
  <p>when i use <code>data.(inputLocation.value)</code> getting the following error :</p>
  
  <blockquote>
    <p>XML filter is applied to non-XML value ({Aspen:[{ID:</p>
  </blockquote>
  
  <pre><code>{
   "Aspen":[
   {
    "ID":"Bellaire",
    "Name":"Bellaire"
   },
   {
    "ID":"Champions Forest",
    "Name":"Champions Forest"
   },
   {
    "ID":"Highland Village",
    "Name":"Highland Village"
   },
   {
    "ID":"Museum District",
    "Name":"Museum District"
   }
   ]
  }
  </code></pre>