Unable to create checkbox

Unable to create checkbox

I'm trying to create checkboxes dynamically, but it's not working. I'm using following code
  1. ( function( $ ) {
  2.     
  3.      $(document).ready(function() {
  4.         $('#services').on("change", function() {

  5.         $('#doclist').empty();
  6.             
  7.         currentCat = $(this).val();
  8.             
  9.         data = $.parseJSON(bookingdata);

  10.             $.each(data[currentCat], function (index, value) {
  11.                 $('<input />', { type: 'checkbox', id: value.id, value: value.name }).appendTo("#doclist");
  12.                 $('<label />', { 'for': value.id, text: value.name }).appendTo("#doclist");
  13.             });
  14.         });
  15.     });
  16. } )( jQuery );
Its working fine when i change input type to text, radio...