title: Dynamic select box change event not working in codeigniter
body: <p>I'm having a drop down which is coming dynamically :-</p>
  
  <p>Controller :- </p>
  
  <pre><code>function get_model_by_make()
  {
      $str = $this-&gt;Comparecars_model-&gt;get_model_by_make();
      echo $str;      
  }
  </code></pre>
  
  <p>Model :-</p>
  
  <pre><code>function get_model_by_make()
      {
          $sql = "SELECT
                      *
                  FROM
                      model
                  WHERE
                      makeid = '".$_POST['make_id']."'
                  ";
  
          $result = $this-&gt;db-&gt;query($sql)-&gt;result_array();
  
          $str = '&lt;select style="width:130px;" class="compare_model_name"&gt;
                      &lt;option value=""&gt;--Select Model--&lt;/option&gt;
                  ';
  
          foreach($result as $result)
          {
              $str .= '&lt;option value="'.$result['model_id'].'"&gt;'.$result['model_name'].'&lt;/option&gt;';       
          }
  
          $str .= '&lt;/select&gt; - ';
           return $str;
      }
  </code></pre>
  
  <p>the above code display selectbox with class name <code>compare_model_name</code>. Now I'm trying to add change event to this class name but it doesn't work:-</p>
  
  <pre><code>$(document).ready(function()
  {    
      $('.compare_model_name').on("change",function()
      {
              alert(); // It does not alert
      }); 
  });
  </code></pre>
  
  <p>Also console is not showing any error.</p>
  
  <p><strong>Edit :-</strong></p>
  
  <p>View :-</p>
  
  <pre><code>  &lt;select style="width:130px;" id="drpMake1" name="drpMake1" class="compare_make_name"&gt;
          &lt;option value=""&gt;--Select Make--&lt;/option&gt;
                  &lt;?php
                      foreach($make as $make)
                      {
                          echo '&lt;option value="'.$make['make_id'].'"&gt;'.$make['make_name'].'&lt;/option&gt;';
                      }
                  ?&gt;    
  
      &lt;/select&gt; - &lt;!-- On selecting it will bring new selectbox which is shown below --&gt;
  
  
      &lt;span id="model_span"&gt;
          &lt;select style="width:130px;" class="aspNetDisabled" disabled="disabled" id="drpModel1" name="drpModel1"&gt;
                  &lt;option value="0" selected="selected"&gt;--Select Model--&lt;/option&gt;
  
          &lt;/select&gt; 
  
  &lt;/span&gt; 
  </code></pre>