首页 > Web开发 > 详细

jQuery EasyUI 下拉菜单获取日期,最高年份为当前年份,最低年份为当前年份向前推10年

时间:2015-09-29 23:17:13      阅读:672      评论:0      收藏:0      [点我收藏+]

http://blog.csdn.net/wangjingjing1014/article/details/16885341

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
  <select class="easyui-combobox" id="cbYearContrast" name="select" panelHeight="auto" style="    width:80px; padding-top:5px; margin-top:10px;">
  </select>
</body>
<script type="text/javascript">
    var currentYear = new Date().getFullYear();
    var select = document.getElementById("cbYearContrast");
    for (var i = 0; i <= 10; i++) {
        var theOption = document.createElement("option");
        theOption.innerHTML = currentYear-i + "年";
        theOption.value = currentYear-i;
        select.appendChild(theOption);
    }
</script>

</html>

获取下拉菜单选中的值:var year = $(‘#cbYearContrast‘).combobox(‘getValue‘);

jQuery EasyUI 下拉菜单获取日期,最高年份为当前年份,最低年份为当前年份向前推10年

原文:http://www.cnblogs.com/zkwarrior/p/4847477.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!