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.