The standard code for DatePicker is:
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
<p>Date: <input type="text" id="datepicker"></p>
How to launch datepicker onclick event from inline HTML, I mean:
<input ... onclick="" >
and with no separate JS code?
I tried:
<p>Date: <input type="text" id="datepicker" onclick="$(function() {$('#datepicker').datepicker();});"></p>
But it's working only on second click.
How to make it work on first click?