title: How to get selected data using onChange event using jQuery Data table?
body: <p>I am working on jQuery Data table to load few data from mysql database. </p>
  
  <p><strong>Here is the html code :</strong> </p>
  
  <pre><code>&lt;table id="employee-grid"  cellpadding="0" cellspacing="0" border="0" class="display" width="100%"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;#&lt;/th&gt;
              &lt;th&gt;User Id&lt;/th&gt;
              &lt;th&gt;Address&lt;/th&gt;
              &lt;th&gt;Package Name&lt;/th&gt;
              &lt;th&gt;Status&lt;/th&gt;
              &lt;th&gt;Action&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p><strong>jQuery code for jQuery Data Table and My Ajax Request :</strong> </p>
  
  <pre><code>$(document).ready(function() {
  
      var dataTable = $('#employee-grid').DataTable( {
          "processing": true,
          "serverSide": true,
          "ajax":{
              url :"server_processing.php", // json datasource
              type: "post",  // method  , by default get
              error: function(){  // error handling
                  $(".employee-grid-error").html("");
                  $("#employee-grid").append('&lt;tbody class="employee-grid-error"&gt;&lt;tr&gt;&lt;th colspan="3"&gt;No data found in the server&lt;/th&gt;&lt;/tr&gt;&lt;/tbody&gt;');
                  $("#employee-grid_processing").css("display","none");
  
              }
          }
      } );
  
      $("#employee-grid").on('change', function() {
          var status = $('.changeStatus').val();
          alert(status);
          $.ajax({
              url : "&lt;?php echo SITE_URL . 'toplevel/update-data'; ?&gt;",
              data : {
                  'statusChange' : status
              }, 
              type : 'POST',
          });
      });
  
  });
  </code></pre>
  
  <p>but When I select the option then every time it's passing <strong>first option value</strong> </p>
  
  <p>For e.g. This <code>selected</code> option tag has these value : </p>
  
  <pre><code>&lt;option value='1|11' $statusMsg1&gt;Active&lt;/option&gt;
  &lt;option value='2|11' $statusMsg2&gt;Blocked&lt;/option&gt;
  </code></pre>
  
  <p>It's always passing <code>1|11</code> value !! It's should be pass my selected option value. I don't understand why it's happening :(</p>