html5 datepicker 使用

来源:互联网 发布:yy主播拍的网络大电影 编辑:程序博客网 时间:2024/06/15 23:51

初始化type为text,使初始值能够显示出来
<input class="choicedate" id="choicedate" type="text" />

var chooseDate = (new Date()).Format("yyyy-MM-dd");
            $("#choicedate").val(chooseDate);//.text(chooseDate);
            $("#choicedate").attr('type', 'date');

监听日期选择事件:
 $("#choicedate").on('input', function () {
               alert($(this).val());
            });
原创粉丝点击