Datepickerhtml
ver 1.7.3 浏览更多jquery
经常使用设置api
1 //禁用今天以前时间 2 $(".datePicker").datepicker('option', { minDate: -0, maxDate: "+10Y" }); 3 4 //选中日期的显示格式 5 var dateFormat = 'yy-mm-dd'; 6 $('.datePicker').datepicker({firstDay: 1 , dateFormat: dateFormat});
js 添加标签,绑定 Datepicker 事件spa
如 js 动态添加如下 html 到页面,code
<input type="text" class="datePicker" readonly="readonly">
1 $('input').addClass("datapicker"); 2 $('input').datepicker({ 3 dateFormat: "yy-mm-dd", 4 changeMonth: true, 5 changeYear: true, 6 showOn: 'both', 7 buttonImageOnly: true, 8 buttonImage: '/public/images/calendar.gif' 9 });