title: How to get the selected date from jquery datepicker
body: <p>I am using jquery datepicker to show a calendar.Now as per my requirement i want to get the date selected by the user in my jquery variable which i will use in my application but i am not able to get the date ..
  Here is the code for datepciker</p>
  
  <pre><code>&lt;div id="datepicker"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>and here i am trying to get the selected code..</p>
  
  <pre><code>$(document).ready(function () {
  
          $("#datepicker").datepicker({
              onSelect: function (dateText, inst) {
                  var date = $(this).val();
                  alert(date);
              }
          });
  
      });
  </code></pre>
  
  <p>But, I am not able to get the date ..Please help me ..Thanks..</p>