title: using $.each jquery to create html select option in ajax success
body: <p>I have a bootstrap modal that contains a form. This form will be using a lot of data from my database, So I use php to get them like this :</p>
  
  <pre><code>public function get_view_for_inspection_report_belum_eor(){
      $q = $this-&gt;inspection-&gt;get_view_for_inspection_report_belum_eor();
      echo json_encode($q);
  }
  </code></pre>
  
  <p>It gives me a new json code like this :</p>
  
  <pre><code>[{
  "NO_INSPECTION": "5",
  "NO_SURAT": "00005",
  "DATE_OF_DESCRIPTION": "2016-01-04 21:00:37",
  "NAMA_SURVEYOR1": "surveyor",
  "NAMA_SURVEYOR2": "surveyor",
  "INSULATION": "3",
  "VESSEL": "MV WAN HAI 171",
  "PREFIX": "EOLU",
  "SERIAL_NUMBER": "1111111",
  "NAMA_CLEAN_ITEM": "SURFONIC AGM 550",
  "TARIFF": "0.00",
  "COMMENTS": "Test Surveyor 1\r\n\r\nTest Surveyor 2"
   }, {
  "NO_INSPECTION": "4",
  "NO_SURAT": "00004",
  "DATE_OF_DESCRIPTION": "2016-01-04 19:33:23",
  "NAMA_SURVEYOR1": "surveyor",
  "NAMA_SURVEYOR2": null,
  "INSULATION": "3",
  "VESSEL": "WAN HAI 202",
  "PREFIX": "EOLU",
  "SERIAL_NUMBER": "1111111",
  "NAMA_CLEAN_ITEM": "REVERTING",
  "TARIFF": "0.00",
  "COMMENTS": "Test Saja"
   }, {
  "NO_INSPECTION": "3",
  "NO_SURAT": "00003",
  "DATE_OF_DESCRIPTION": "2016-01-04 19:26:15",
  "NAMA_SURVEYOR1": "surveyor",
  "NAMA_SURVEYOR2": null,
  "INSULATION": "2",
  "VESSEL": "WAN HAI 202",
  "PREFIX": "EOLU",
  "SERIAL_NUMBER": "1111111",
  "NAMA_CLEAN_ITEM": "SUBASA",
  "TARIFF": "0.00",
  "COMMENTS": "Test surveyor 1"
   }, {
  "NO_INSPECTION": "2",
  "NO_SURAT": "00002",
  "DATE_OF_DESCRIPTION": "2016-01-04 15:15:23",
  "NAMA_SURVEYOR1": "surveyor",
  "NAMA_SURVEYOR2": null,
  "INSULATION": "3",
  "VESSEL": "WAN HAI 202",
  "PREFIX": "EOLU",
  "SERIAL_NUMBER": "2222222",
  "NAMA_CLEAN_ITEM": "TEXANOL ESTER ALKOHOL",
  "TARIFF": "0.00",
  "COMMENTS": "Test"
   }, {
  "NO_INSPECTION": "1",
  "NO_SURAT": "00001",
  "DATE_OF_DESCRIPTION": "2016-01-04 19:13:07",
  "NAMA_SURVEYOR1": "surveyor",
  "NAMA_SURVEYOR2": "surveyor",
  "INSULATION": "1",
  "VESSEL": "MV.WAN HAI 171",
  "PREFIX": "EOLU",
  "SERIAL_NUMBER": "1111111",
  "NAMA_CLEAN_ITEM": "N-BUTANOL",
  "TARIFF": "0.00",
  "COMMENTS": "Test survey 1\r\nTest survey 2"
  }]
  </code></pre>
  
  <p>This is my ajax</p>
  
  <pre><code>$('#add_eir').click(function () {
      action = "TAMBAH";
      $.ajax({
          url : "&lt;?= site_url('admin/c_admin_eir/get_view_for_inspection_report_belum_eor'); ?&gt;",
          type : "POST",
          dataType : "json",
          success : function(response){
              $("#dynamic_no_inspection").find(':first-child').remove();
  
              //  CREATE A SELECT OPTION
              $("#dynamic_no_inspection").html('&lt;select data-placeholder="Pilih no inpeksi..." class="form-control chosen-select" name="no_inspection" id="no_inspection" style="width:250px;" tabindex="2"&gt;' +
              '&lt;option&gt;&lt;/option&gt;' +
  
               // How to create an option based ajax response  ?
  
              '&lt;/select&gt;');
          }
      });
  
  
   });
  </code></pre>
  
  <p>Now, the question is? How to make the option based the ajax response using jquery. I expected the <code>&lt;option&gt;</code> be like this :</p>
  
  <pre><code>&lt;option value="response[i].NO_INSPECTION" . "&gt; response[i].NO_SURAT ( response[i].PREFIX - response[i].SERIAL_NUMBER ) &lt;/option&gt;
  </code></pre>
  
  <p>I knew in php, just loop using </p>
  
  <pre><code>foreach ($all_inspection_belum_eor as $row) :
     echo "&lt;option value=" . "$row-&gt;NO_INSPECTION" . "&gt; $row-&gt;NO_SURAT ( $row-&gt;PREFIX - $row-&gt;SERIAL_NUMBER ) &lt;/option&gt;";
  endforeach;
  </code></pre>
  
  <p>For any help, it so appreciated.</p>