JQuery UI date picker works only after re-focus
<p>The following code opens date picker only after I click in .datepicker field, click somewhere else, and then click in .datepicker again.</p>

<pre><code>$(document.body).on("click", ".datepicker", function() {
$( ".datepicker" ).datepicker({
});
});
</code></pre>

<p>Please advise how to make it work without the "preparatory click".</p>