JSFiddle - React, Tailwind, and code Playground

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/themes/redmond/jquery-ui.css">
<button id="b1">works</button>
<button id="b2">doesn't work</button>
<span id="info"></span>

<div id="x1"></div>
<div id="x2"></div>

CSS

#x > div { background: #ff0; min-height: 1em; }

JavaScript

$('#b1').click(function() {
    var tmp = $('<div/>').appendTo('#x1').datepicker();
    $('#info').text('Dimensions: w=' + tmp.width() + '; h=' + tmp.height());
});

var dp = $('<div/>').datepicker();
$('#b2').click(function() {
    var tmp = $('<div/>').datepicker().appendTo('#x2');
    $('#info').text('Dimensions: w=' + tmp.width() + '; h=' + tmp.height());
});