title: getting textbox value using jquery
body: <p>I have textbox with generated html </p>
  
  <pre><code>&lt;input id="datePicker" class="date hasDatepicker" type="text" value="" name="date"&gt;
  
  $(document).ready(function () {
          var data = $("#datePicker").val();
  
          $(".dateBtn").click(function (event) {
              FetchDetails(data);
          })
  ....
  </code></pre>
  
  <p>Onclick textbox is populated at the page but no value is being sent to the FetchDetails function. What I am doing wrong here?</p>
  
  <p>Thanks</p>