codegeek codegeek - 5 months ago 33x
jQuery Question

Bind jquery UI date-picker on focus of input element

Hi i have a situation like i need to bind the jquery UI datepicker({}) function when the input element is focused.i am not able to achieve it with the below code ,so guys plz help how can i bind the datepicker function when the input element is focused

<!DOCTYPE html>
<link rel="stylesheet" href="">
<title> Jquery UI Date Picker </title>

<input type="text" id="date" />

<script src=""></script>
<script src=""></script>


You can open datepicker using onclick event:

<input type="text" id="date" onclick="$('#date').datepicker();$('#date').datepicker('show');" />


$( "#date" ).focus(function() {