title: click on select dropdown to call ajax
body: <p>i've a problem calling ajax when I click the dropdown with select2.
  this is my html code: </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>//call ajax when select button do click
  function showAjax() {
      $.ajax({
        type: "POST",
        url: "hanca/hanca_crud.php",
        dataType: 'json',
        data: {
          type: "get_hanca"
        }, //get_kode_hanca dan nama model serta jumlahnya
        success: function(data) {
          console.log(data);
          var teks = "";
          $.each(data, function(index, val) { //looping table detail bahan
            var id_hanca = val.id_hanca;
            var nama_model = val.nm_model;
            var sisa = val.jumlah_hanca;
  
            teks += "&lt;option value='" + id_hanca + "'&gt;" + nama_model + " - " + id_hanca + " - [sisa " + sisa + " Pcs]" + "&lt;/option&gt;";
          });
          $(".id_hanca").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;select onchange="anotherAjax(this)" onclick="showAjax" name="id_hanca[]" class="form-control id_hanca" required=""&gt;
    &lt;option value=""&gt;- SELECT&lt;/option&gt;
  &lt;/select&gt;</code></pre>
  </div>
  </div>
  
  is this possible? </p>