onclick on button to add text field not working

I am using the onclick event to add a text field when a button is clicked. It is working for the time div (see image below) but not the pickup div.

enter image description here

JS:

function clickedfun(id) {      var count = jQuery('#total_time_rec'+id).val();     console.log('id'+id);     count++;      jQuery('#here'+id).append('<div class="time_slot"><input type="text" name="_pro_service_price['+id+'][time]['+count+']" placeholder="HH:ii" class="services_time"/><div class="remove_img remove_shortcode" id="">X</div></div><script>jQuery(".services_time").timepicker();</script>');      jQuery('#total_time_rec').val(count);      return false; };  function clickedfun2(id) {      var pickupcount = jQuery('#total_pickup_rec'+id).val();     console.log('id'+id);     pickupcount++;      jQuery('#pickuphere'+id).append('<div class="pickup_slot"><input type="text" name="_pro_service_price['+id+'][pickup]['+pickupcount+']" placeholder=""/><div class="remove_img remove_shortcode" id="">X</div></div>');      jQuery('#total_pickup_rec').val(pickupcount);      return false; }; 

PHP:

echo '<!--time--> <tr class="label_tr">     <td class="label_title"><label for="_pro_service_price['.$  id.'][is_active]">Time</label></td>     <td style="width: 40%;">';     if(!empty($  value->time)){         $  time_slots = $  value->time;         $  count = count($  time_slots);          foreach ($  time_slots as $  key => $  time) {             echo '<div class="time_slot"><input type="text" name="_pro_service_price['.$  id.'][time]['.$  key.']" placeholder="HH:ii" class="services_time" value="'.$  time.'"/>             <div class="remove_img remove_shortcode" id="">X</div>             </div>';         }     }else{         echo '<div class="time_slot"><input type="text" name="_pro_service_price['.$  id.'][time][1]" placeholder="HH:ii" class="services_time"/>             <div class="remove_img remove_shortcode" id="">X</div>         </div>';         $  count = 1;     }          echo '<div id="here'.$  id.'"></div>         <div class="add_img button button-primary button-large" id="add_shortcode" onclick="clickedfun('.$  id.')">Add Time</div>         <input type="hidden" value="'.$  count.'" id="total_time_rec'.$  id.'">     </td>     <td></td> </tr>  <!--pickup--> <tr class="label_tr">     <td class="label_title"><label for="_pro_service_price['.$  id.'][is_active]">Pickup</label></td>     <td style="width: 40%;">';     if(!empty($  value->pickup)){         $  pickup_slots = $  value->pickup;         $  pickupcount = count($  pickup_slots);          foreach ($  pickup_slots as $  key => $  pickup) {             echo '<div class="pickup_slot"><input type="text" name="_pro_service_price['.$  id.'][pickup]['.$  key.']" placeholder="" value="'.$  pickup.'"/>             <div class="remove_img remove_shortcode" id="">X</div>             </div>';         }     }else{         echo '<div class="pickup_slot"><input type="text" name="_pro_service_price['.$  id.'][pickup][1]" placeholder=""/>             <div class="remove_img remove_shortcode" id="">X</div>         </div>';         $  pickupcount = 1;     }          echo '<div id="pickuphere'.$  id.'"></div>         <div class="add_img button button-primary button-large" id="add_shortcode2" onclick="clickedfun2('.$  id.')">Add Pickup</div>         <input type="hidden" value="'.$  pickupcount.'" id="total_pickup_rec'.$  id.'">     </td>     <td></td> </tr>';