title: How to populate HTML Combo box with JSON object
body: <p>I am creating an user registration form using jsp,in which there is an option to select State from a combo box.I am using a simple html combo box but i am receiving State as a json object from web service.So how to populate the combo box with json object.</p>
  
  <p>State Json is as follows,</p>
  
  <pre><code>{"States":[{"id":"1","stateName":"Alabama","code":"AL"},
  {"id":"4","stateName":"Arkansas","code":"AR"},
  {"id":"8","stateName":"Delaware","code":"DE"}]}
  </code></pre>
  
  <p>My Javascript function is,</p>
  
  <pre><code>function getStates(){    
  url = WSPath;
  response=initiateRequest(url);}
  </code></pre>
  
  <p>My HTML combo box is <code>&lt;select name="State"&gt;</code></p>
  
  <p>I need to populate the combo-box with the above json object.</p>