JQuery UI Date Picker sometimes opens blank web page
<p>I'm using the JQuery UI Datepicker and when the code runs and the date picker is used it sometimes opens a blank web page. Any idea on how I can get this fixed?</p>

<pre><code>var viewDashboardJobs = (function viewDashboardJobs() {

var _create = function _create() {

    var input09 = window.document.createElement("input");
    input09.setAttribute("id", "agency-brief-date");
    input09.setAttribute("type", "text");
    input09.setAttribute("name", "agency-brief-date");
    input09.setAttribute("title", "Please provide the agency brief date.");
    window.document.body.appendChild(input09);

    var agencyBriefDate = window.document.createElement("button");
    agencyBriefDate.setAttribute("type", "button");
    agencyBriefDate.setAttribute("onclick", "viewDashboardJobs.pickDate(document.querySelector('#agency-brief-date'));");
    agencyBriefDate.innerHTML = "Pick a date";
    window.document.body.appendChild(agencyBriefDate);

};

var _pickDate = function _pickDate(node) {    
    node.value = "";
    var id = "#" + node.id;    
    $(id).datepicker($.datepicker.regional['en']);
    $(id).datepicker("option", "dateFormat", "dd/mm/yy" );
    $(id).datepicker();
    $(id).datepicker("show");
    $(id).mouseover(function(e) {
        $(this).datepicker("destroy");
    });
};

return {
  create : _create,
  pickDate : _pickDate
}

})().create();
</code></pre>