JSFiddle - React, Tailwind, and code Playground

by mart01

HTML

<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
		<div class="row">
    		
    		<div class="entry">
    			 <div id="child">
	<div class="add-child">
    			<input type="text" name="event_date" class="datepicker" />
    			
    		</div> </div></div>  <button type="button" id="add_child">Add another child</button>
    		
		</div>
		
		<input type="submit" value="post" />

JavaScript

$('#add_child').click(function() {  
        var clone = $('.add-child:first').clone(true).appendTo('#child');
	    clone.find('.child_dob').datepicker();
      var deleteLink = $("<a>delete</a>");
             deleteLink.appendTo(clone);
             deleteLink.click(function(){
                 clone.remove();
             });  
    }); 
    
    (function($){
            
            $.fn.eventeditor=function(config){
                
                return this.each(function(i){
                    
                    $(this).find('input.datepicker').datepicker({ defaultDate: '2013/02/05', dateFormat: "yy/mm/d"});
                    
                });
            };
            
            // execute
            $('div.entry').eventeditor();
                    
        })(jQuery);