0

I'm trying to use datepicker of Jquery, but it seems I cannot catch the selected value of my datepicker.

My added HTML is:

test Date:<input type="text" id="testDate" placeholder="yyyy-mm-dd"/>
<input type="button" id="testbtn" value="my button"/>

in my javascript inside

$(document).ready(function() { 

I have the following code:

$("#testDate").datepicker({dateFormat: "yy-mm-dd"});
$('#testbtn').click(function() {
    console.log($('#testDate').val());
});

but nothing is written in my console! Am I missing something? Please let me know if you need more clarification.

j08691
  • 204,283
  • 31
  • 260
  • 272
user385729
  • 1,924
  • 9
  • 29
  • 42
  • 4
    looks fine http://jsfiddle.net/arunpjohny/ZNrAQ/1/ – Arun P Johny Oct 28 '13 at 15:43
  • Thanks buddy for letting me know! I just figured out that I had the following erro Uncaught TypeError: Object [object Object] has no method 'click' and the following thread solved my problem http://stackoverflow.com/questions/10912346/uncaught-typeerror-object-object-object-has-no-method-on Thanks – user385729 Oct 28 '13 at 16:05

0 Answers0