I am trying to add the rows dynamically, but date-picker is not Creating new rows. It works for the first row alone, but not for subsequent rows. PFB the code.:

```
var counter = 2;
    var limit = 100;
    $(function() 
            {
             $( ".datepicker" ).removeAttr('id').removeClass('hasDatepicker').datepicker({ dateFormat: 'ddMyy',  minDate: '0' , maxDate: '366'});
            });

    function addInput(count){
         if (counter == limit)  {
              alert("You have reached the limit of adding " + counter + " inputs");
         }
         else {
              $("#btn"+(count-1)).hide();
               //document.getElementById(divName).appendChild(newdiv);    
              $("#appendTag").append("<tr id='record"+count+"'><td><input type='text' name='fn[]'></td><td><input type='text' name='cab[]'></td><td><input type='text' name='sd[]' class='sd"+count+" datepicker'></td>"
                                        +"<td><input type='text' name='ed[]' class='ed"+count+" datepicker'></td><td><input type='text' name='brd[]' maxlength='3'></td><td><input type='text' name='off[]' maxlength='3'></td><td><input type='text' name='seats[]' maxlength='3'></td>"
                                          +"<td><input type='text' name='dow[]' maxlength='7'></td><td><input type='button' value='Add' id='btn"+count+"'  onClick='addInput("+(++count)+");'/></td><td><input type='button' value='x' id='cross"+count+"' onclick = 'Remove("+(count-1)+");'/></td></tr>");

                          $( ".sd"+count).datepicker({ dateFormat: 'ddMyy',  minDate: '0'});
                          $( ".ed"+count).datepicker({ dateFormat: 'ddMyy',  minDate: '0'});
              counter++;
         }
    }
    function Remove(count){
         $("table tbody").find('tr#'+'record'+count).each(function(){
                    counter--;
                    if(counter == 2){
                         $("#btn0").show();
                    } else
                    if($("#btn"+count).is(':visible')){
                     //$("#btn"+(count-1)).show();
                        for(i=(count-1);i>0;i--)
            {
                if ($("#btn"+i).length) {
                $("#btn"+i).show();
                 break;
               }
                        }
                    }  
                     $(this).remove();
            });
   }
-----------------------------------------------------------

<div id="dynamicInput">
            <table>
                <tr>&nbsp;
                </tr>
                <tr>&nbsp;
                </tr>
                <tr>
                    <td>Flight No</td>
                    <td>Class</td>
                    <td>Start Date</td>
                    <td>End Date</td>
                    <td>Origin</td>
                    <td>Destination</td>
                    <td>No Of Seats</td>
                    <td>Days Of Week</td>
                </tr>
                <tbody id="appendTag">
                    <tr id="record0">
                        <td><input type="text" name="fn[]" maxlength="6"></td>
                        <td><input type="text" name="cab[]" maxlength="1"></td>
                        <td><input type="text" name="sd[]" class="sd0 datepicker"></td>
                        <td><input type="text" name="ed[]" class="ed0 datepicker"></td>
                        <td><input type="text" name="brd[]" maxlength="3"></td>
                        <td><input type="text" name="off[]" maxlength="3"></td>
                        <td><input type="text" name="seats[]" maxlength="3"></td>
                        <td><input type="text" name="dow[]" maxlength="7"></td>
                        <td><input type="button" value="Add" id="btn0"
                            onClick="addInput(<%=++count%>);"></td>
                        <td><input type="button" value="x" id="cross0"
                            style="display: none;" /></td>
                    </tr>
                </tbody>
            </table>

        </div>

```