title: How to put AJAX response in select tag?
body: <p>Here is my HTML</p>
  
  <pre><code>&lt;select class="expand" id="search_category" style="display: none;"&gt;
   &lt;option value=""&gt;&lt;/option&gt;
   &lt;option value="Sports"&gt;Sports&lt;/option&gt;
   &lt;option value="Arts &amp; Music"&gt;Arts &amp; Music&lt;/option&gt;
   &lt;option value="Academic &amp; Tech"&gt;Academic &amp; Tech&lt;/option&gt;
   &lt;option value="Odd Jobs"&gt;Odd Jobs&lt;/option&gt;
   &lt;/select&gt;
  </code></pre>
  
  <p>When I selects any option, on change jQuery AJAX is called. Here is JSON response </p>
  
  <pre><code>["Lacrosse","Squash","Basketball","Swimming","Golf","Tennis","Football","Other","Baseball"]
  </code></pre>
  
  <p>I also tried to get HTML response like this way</p>
  
  <pre><code>&lt;option value=""&gt;&lt;/option&gt;
  &lt;option value="Lacrosse"&gt;Lacrosse&lt;/option&gt;
  &lt;option value="Squash"&gt;Squash&lt;/option&gt;
  &lt;option value="Basketball"&gt;Basketball&lt;/option&gt;
  &lt;option value="Swimming"&gt;Swimming&lt;/option&gt;
  &lt;option value="Golf"&gt;Golf&lt;/option&gt;
  &lt;option value="Tennis"&gt;Tennis&lt;/option&gt;
  &lt;option value="Football"&gt;Football&lt;/option&gt;
  &lt;option value="Other"&gt;Other&lt;/option&gt;
  &lt;option value="Baseball"&gt;Baseball&lt;/option&gt;
  </code></pre>
  
  <p>But failed to put either of these two responses into below HTML select tags.</p>
  
  <pre><code>&lt;select id="showSubCats"&gt;&lt;/select&gt;
  </code></pre>
  
  <p>jQuery is running correctly. I can alert these values. How to put these values into select tags like? </p>
  
  <pre><code>&lt;select id="showSubCats"&gt;
  &lt;option value=""&gt;&lt;/option&gt;
  &lt;option value="Lacrosse"&gt;Lacrosse&lt;/option&gt;
  &lt;option value="Squash"&gt;Squash&lt;/option&gt;
  &lt;option value="Basketball"&gt;Basketball&lt;/option&gt;
  &lt;option value="Swimming"&gt;Swimming&lt;/option&gt;
  &lt;option value="Golf"&gt;Golf&lt;/option&gt;
  &lt;option value="Tennis"&gt;Tennis&lt;/option&gt;
  &lt;option value="Football"&gt;Football&lt;/option&gt;
  &lt;option value="Other"&gt;Other&lt;/option&gt;
  &lt;option value="Baseball"&gt;Baseball&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>And the jQuery</p>
  
  <pre><code>jQuery(function(){
      jQuery('#search_subcategory').css('display','none');
      jQuery('#search_category_loader').css('display','none');
      jQuery('#search_category').on('change',function(){
          var category = jQuery(this).val();
          jQuery('#search_category_loader').css('display','block');
          jQuery.ajax({
              type: 'POST',
              data: {'ajaxreturn':131, 'searchCat': category},
              url: '&lt;?php bloginfo('url') ?&gt;/',
              //success:function(result){
              success: function(data){
                  jQuery('#showSubCats').html(data); 
                  jQuery('#search_subcategory').css('display','block');
                  jQuery('#search_category_loader').css('display','none');
              },
              dataType: "html"
          });
      });
  });
  </code></pre>