title: destroy datepicker on after select sepesific value
body: <p>i want to remove class <code>datepicker</code>  in my code after change the select option, but its but its not working properly
  this my code</p>
  <pre><code> &lt;?php for ($i = 0; $i &lt; $anak; $i++) {
              # code...
              $b = $i + 1;
          ?&gt;
              &lt;div class=&quot;card shadow mb-4&quot;&gt;
                  &lt;div class=&quot;card-header py-3&quot;&gt;
                      &lt;h6 class=&quot;m-0 font-weight-bold text-primary&quot;&gt;&lt;?= 'Detail ' . $b ?&gt;&lt;/h6&gt;
                  &lt;/div&gt;
                  &lt;div class=&quot;card-body&quot;&gt;
  
                      &lt;div class=&quot;form-row&quot;&gt;
                          
                          &lt;div class=&quot;form-group col-lg-3&quot;&gt;
                              &lt;label for=&quot;identitas&quot;&gt;Type ID&lt;/label&gt;
                              &lt;select class=&quot;custom-select my-1 mr-sm-2 idanak select2&quot; name=&quot;type&quot;&gt;
                                  &lt;option&gt;&lt;/option&gt;
                                  &lt;?php foreach ($kia as $key =&gt; $value) {
                                  ?&gt;
                                      &lt;option value=&quot;&lt;?= $value['cardtype_id'] ?&gt;&quot;&gt;&lt;?= $value['cardtype_name'] ?&gt;&lt;/option&gt;
  
                                  &lt;?php } ?&gt;
                              &lt;/select&gt;
                          &lt;/div&gt;
  
                          &lt;div class=&quot;form-group anak col-lg-3&quot;&gt;
                              &lt;label for=&quot;identitas&quot;&gt;Data&lt;/label&gt;
                              &lt;input name=&quot;vale[]&quot; type=&quot;text&quot; class=&quot;form-control classforval datepicker&quot; placeholder=&quot;Masukkan Tanggal Lahir&quot; required&gt;
                          &lt;/div&gt;
                          
  
                      &lt;/div&gt;
  
  
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;?php } ?&gt;
      ```
  
  this my jquery 
  
  </code></pre>
  <p>$(document).ready(function() {</p>
  <pre><code>    $('.idanak').on('change', function() {
          var val = $(this).find(&quot;option:selected&quot;).text()
          if (val==='KIA') {
             $('.classforval').datepicker('destroy');
             
          }
  
      })
  })
  </code></pre>
  <pre><code>
  but it destroy all datepicker, but i want only in the same card body to be destroy
  any idea ?
  </code></pre>