title: How to render mongodb _id in html in ajax?
body: <p>I am using ajax function to fetch employees like below lines of code. I am trying to add mongodb _id field in checkbox id attribute. After rendering in browser the output is as </p>
  
  <pre><code>               &lt;input id="[object Object]" type="checkbox"&gt;
  
                     $.ajax({
                          url: 'index.php?action=fetchEmployees',
                          type: 'POST',
                          dataType: 'JSON',
                          data: {department: department},
                          success: function (data) {
  
                              $('.filter-table').css("display","block");
                              $('.dataTables-example tbody').empty();
  
                              if (data.length) {
                                      var k = 0;
                                      for (var i in data) {
                                          k++;
  
                                          $("#studentlistmarkscardbody").append('&lt;tr&gt;' +
                                          '&lt;td style="text-align: center;"&gt;' + '&lt;div class="checkbox checkbox-success"&gt;&lt;input id="'+ data[i]['_id'].valueOf() +
                                          '" type="checkbox"/&gt;&lt;label&gt;&lt;/label&gt;&lt;/div&gt;&lt;/td&gt;'
         ...
         ...
         }
       }
     });
  </code></pre>
  
  <p>The json data is as </p>
  
  <pre><code>      {
      "_id" : ObjectId("57b328a71999967009987"},
      "Photo" : "",
      "EmployeeNumber" : "4395",
      "JoiningDate" : ISODate("201
      "FullName" : "Julia Ramirez"
      "Email" : "jmorgan2@godaddy.
      "Gender" : "Female",
      "DOB" : ISODate("1986-06-10T
      "BiometricID" : "3",
      "Department" : ObjectId("570
      "Category" : "Rev",
      "Position" : "sociis natoque
      "Grade" : "consequat morbi"
      }
  </code></pre>
  
  <p>I have tried  data[i]['_id'].valueOf() but it is not working...
  Please help !!!</p>