title: Jquery-nice-select plugin not working properly
body: <p>I am using Jquery-nice-select plugin.(<a href="http://hernansartorio.com/jquery-nice-select/" rel="nofollow noreferrer">http://hernansartorio.com/jquery-nice-select/</a>).</p>
  
  <p>I have two select dropdowns. In the first one, I am displaying the country name form database and In second dropdown I am displaying the state name depending upon the country name. </p>
  
  <p>I am able to display the both but the issue is, When I am selecting the country name then state name is displaying but that are not displaying inside select drop down. even I am not able to select it. Please check the below image.
  Would you help me out in this?</p>
  
  <p>Before</p>
  
  <p><a href="https://i.stack.imgur.com/XDtjR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XDtjR.png" alt="enter image description here"></a></p>
  
  <p>After selecting the country name</p>
  
  <p><a href="https://i.stack.imgur.com/dWxwO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dWxwO.png" alt="enter image description here"></a></p>
  
  <pre><code>&lt;?php 
  include('connection.php');
  $country_list="SELECT id,name FROM countries";
  /* create a prepared statement */
  if ($stmt = $conn-&gt;prepare($country_list)) {
      /* execute statement */
      $stmt-&gt;execute();
      /* bind result variables */
      $stmt-&gt;bind_result($id, $country_name);
      }
   ?&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
        &lt;link rel="stylesheet" href="css/nice-select.css"&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;!--country name--&gt;
       &lt;select  name="country_data" class="myselect form-control country_data"&gt;
                          &lt;option  value="" disabled selected&gt;Select your country&lt;/option&gt;
                              &lt;?php  
                               while ($stmt-&gt;fetch()) {?&gt;
                              &lt;option value="&lt;?php echo $id;?&gt;"&gt;&lt;?php echo $country_name;?&gt;&lt;/option&gt;
                              &lt;?php }?&gt;
                       &lt;/select&gt;
  
      &lt;!--state name--&gt;
                  &lt;select  name="state"  class="myselect form-control state_get"&gt;
                  &lt;option value=''&gt;Select state&lt;/option&gt;
                  &lt;/select&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/jquery.nice-select.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
        $(document).ready(function() {
    $('select').niceSelect();
  });
  
  $(document).ready(function() {
   $(".country_data").on('change',function(){
  var country_id=$(this).val();
  $.ajax({
      url:"process.php?key=state_retrive",
      method:"POST",
      data:'id='+country_id,
      success:function(data){
       $('.state_get').html(data);
       //alert(data);
      }
     });
      });
      });
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Process.php</strong></p>
  
  <pre><code>&lt;?php 
  ob_start();
  session_start();
  include('connection.php');
  
  switch($_GET['key']) {
  case 'state_retrive':state_retrive($conn);break;
  default : redirect('index.php');
  }
  
  function state_retrive($conn)
  {
  
  if (isset($_POST['id'])) {
  
    $country_id=$conn-&gt;real_escape_string(trim($_POST['id']));
    $state_data="SELECT name,id FROM `states` WHERE country_id=?";
    //echo $state_data;
  if ($stmt = $conn-&gt;prepare($state_data)) {
  /* bind parameters for markers */
      $stmt-&gt;bind_param("s", $country_id);
      /* execute query */
      $stmt-&gt;execute();
      /* bind result variables */
      $stmt-&gt;bind_result($state_name, $id);
      /* fetch value */
      echo $states="&lt;option value=''&gt;Select state&lt;/option&gt;";
      while ($stmt-&gt;fetch()) {
        $states="&lt;option value=".$id."&gt;".$state_name."&lt;/option&gt;";
        echo $states;
        }
  
      /* close statement */
      $stmt-&gt;close();
  }
   $conn-&gt;close();
  }
  }
   ?&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/rXc6n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rXc6n.png" alt="enter image description here"></a></p>