title: jQuery:Trying to append the options to select tag
body: <p>Hi I am trying to append the options based on input to select tag. but options are not appending. I am not even getting the errors so where is the fault not able to understand.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>  &lt;div class="col-lg-5"&gt;
        &lt;div class="input-group"&gt;
            &lt;label&gt;Select type of Graph&lt;/label&gt;    
            &lt;select data-placeholder="Select Field..." id="graph_name" style="width:300px;" name="team_name" class="chosen-select" tabindex="2"&gt;
  
            &lt;/select&gt;
        &lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p><strong>jQuery:</strong></p>
  
  <pre><code>$('#field_name').change(function() {
    var fieldname = $('#field_name option:selected').val();
    $.post('&lt;?php echo BASE_URL . 'php/processing/formDashboard/graph/showPossibleGraphs.php?id=' . $_GET['id']; ?&gt;', {fieldname: fieldname}, function(data) {
      $.each(data.graphs, function(index, value) {
        $.each(value, function(index, value) {
          console.log(value.id);
          console.log(value.text);
          var option = '&lt;option value="'+value.id+'"&gt;'+value.text+'&lt;/option&gt;';
          $('#graph_name').append(option);
        });
      });
    });
  });
  </code></pre>
  
  <p>Here is the screenshot
  <img src="https://i.stack.imgur.com/1K41y.png" alt="This is the image when i selected the option from one dropdown &amp; the data came from script in JSON format"></p>
  
  <p>This is the image when i selected the option from one dropdown &amp; the data came from script in JSON format</p>
  
  <p><img src="https://i.stack.imgur.com/BmtxY.png" alt="This is the firebug debugging screenshot that shows that data is getting appended but on click it is showing nothing"></p>
  
  <p>This is the firebug debugging screenshot that shows that data is getting appended but on click it is showing nothing
  My sample data is this:</p>
  
  <pre><code>sample data: {
    "status":"OK",
    "response":200,
    "graphs":[[
      {"id":"B","text":"Bar Chart"},
      {"id":"D","text":"Doughnut Chart"},
      {"id":"P","text":"Pie Chart"}
    ]]
  }
  </code></pre>