title: jquery select option set value from json
body: <p>i've code html like : </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$.ajax({
    type: "POST",
    url: "hanca/hanca_crud.php",
    dataType: 'json',
    data: {
      id_hanca: id_hanca,
      type: "detail_hanca"
    }, //detail_hanca
    success: function(data) {
  
      var teks = "";
      $.each(data.detail, function(indeks, nilai) {
        //status hanca
        var tmp1 = nilai.status_detail_hanca;
        $("select.status_detail_hanca").val(tmp1);
  
        var no = nilai.no;
        var status_detail_hanca = "&lt;select class='status_detail_hanca' name='status_detail_hanca[]' &gt;&lt;option value='0'&gt;Proses&lt;/option&gt;&lt;option value='1'&gt;Return&lt;/option&gt;&lt;option value='2'&gt;Selesai&lt;/option&gt;&lt;/select&gt;";
        teks += "&lt;tr&gt;" + no +
          "&lt;/td&gt;&lt;td&gt;" + status_detail_hanca +
          "&lt;/td&gt;&lt;/tr&gt;";
      });
      $(".tbody_detail_hanca_checking").append(teks);
    }
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  
  
  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;No.&lt;/th&gt;
        &lt;th&gt;Status Proses&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody class="tbody_detail_hanca_checking"&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>and this output json : </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>{
   "detail": [{
    "status_detail_hanca": "2",
    "no": 1
   }, {
    "status_detail_hanca": "0",
    "no": 2
   }]
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>i use ajax to get data by json, i want create a <code>select option</code> and set the <code>value</code> data from json. but, its not work. how to fix it ?</p>
  
  <p><strong><em>text dummy for allow code</em></strong> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi vel fermentum massa, quis viverra lectus. Aliquam tristique feugiat volutpat. Donec elementum sapien vel enim facilisis sollicitudin. Integer pellentesque volutpat enim</p>