/* dates starts here*/ $(document).on('click', ".btn_less1", function (){ var len = $('.cloned-row2').length; if(len>1){ $(this).closest(".btn_less1").parent().parent().parent().remove(); } }); /*dynamic row for Test Score Table ends here*/ /*dynamic row for Work Experience Table starts here*/ var count=0; $(document).on("click", ".exp_add_button", function () { var $clone = $('.cloned-row3:eq(0)').clone(true,true); $clone.find('[id]').each(function(){this.id+='someotherpart'}); $clone.find('.btn_more').after("<input type='button' class='btn_less1 selbtnless' id='buttonless'/>") $clone.attr('id', "added"+(++count)); $clone.find(".startDate").val(''); $clone.find(".endDate").val(''); /*$clone.find(".degree_Description").attr('disabled', true).val('');*/ $clone.find("input.startDate") .removeClass('hasDatepicker') .removeData('datepicker') .unbind() .datepicker({ dateFormat: "mm-dd-yy", changeMonth: true, yearRange: "-100:+0", changeYear: true, maxDate: new Date(), showButtonPanel: false, beforeShow: function () { setTimeout(function (){ $('.ui-datepicker').css('z-index', 99999999999999); }, 0); } }); $clone.find("input.endDate") .removeClass('hasDatepicker') .removeData('datepicker') .unbind() .datepicker({ dateFormat: "mm-dd-yy", changeMonth: true, yearRange: "-100:+0", changeYear: true, maxDate: new Date(), showButtonPanel: false, beforeShow: function () { setTimeout(function (){ $('.ui-datepicker').css('z-index', 99999999999999); }, 0); } }); $(this).parents('.wrk_exp').after($clone); });
Here is the fiddle http://jsfiddle.net/karthic2914/bqgjro6d/
Kindly please suggest me
Thanks & Regards