jQueryUI Ticket 8434

Attempting to reproduce jQueryUI ticket 8434 without ASP.NET

HTML

<link rel="stylesheet" href="http://code.jquery.com/ui/1.8.21/themes/base/jquery-ui.css">
<select id='mySel'>
    <option value='Foo'>Foo</option>
    <option value='Bar'>Bar</option>
</select>
    <div id='container'>
<input type='text' id='myText' />
</div>

JavaScript

$(document).ready(function()
                  {
                      $('#myText').datepicker({ changeYear: true, showButtonPanel: true, yearRange: '-2:+2' });
                      
                      $('#mySel').focusout(function()
                                           {
                                               setTimeout(function()
                                                          {
                                                              //$('#myText').remove();
                                                              //$('#container').html("<input type='text' id='myText' />");
                                                              document.getElementById('container').innerHTML = "<input type='text' id='myText' />";
                                                              $('#myText').datepicker({ changeYear: true, showButtonPanel: true, yearRange: '-2:+2' });
                                                          }, 100);
                                           });
                  });