如何在 jQuery ui 中获取数据选择器的数据?我有下一个代码,但只获得默认值。(我只用几年)
$('#datePickerTempe').datepicker( {
changeMonth: false,
changeYear: false,
dateFormat: 'MM yy',
//To hide months:
stepMonths: 12,
monthNames: ["","","","","","","","","","","",""],
//Range
minDate: '-4y', //'M'-> month | 'w'-> week | 'd'-> day
maxDate: '0y',
buttonImageOnly: true
});
$('#datePickerTempe').on('click', function(){
console.log('año: '+$('#datePickerTempe').val()); });