纯JS实现单独年月日历选择

这篇博客介绍了如何使用纯JavaScript实现单独的年月日历选择功能。作者分享了一个简单的Demo,虽然代码基础,但希望能对初学者有所帮助。内容包括HTML和JS代码示例。
摘要由CSDN通过智能技术生成

纯JS实现单独年月日历选择

一般情况下,只是单独年日历或者年月日历这样的时间空间蛮少的,jeDate这个时间控件第一次用,感觉挺全面的,我自己闲着无聊也自己写个小demo实现年月选择,虽然写的很垃圾,但还是记录下,如果有用的话,希望能帮到别人,下面,直接上代码
*

html代码

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    //需要引入的只有一个jq,这里换下路径就可以了
    <script src="../style/lib/jquery/jquery.min.js"></script>
    <style>
    //这里是我写的一些样式,
        input {
            padding-left: 5px;
            box-sizing: border-box;
            width: 250px;
            height: 38px;
            line-height: 1.3;
            line-height: 38px\9;
            border-width: 1px;
            border-style: solid;
            background-color: #fff;
            border-radius: 2px;
            border-color: #d2d2d2;
        }

        #data {
            position: relative;
        }

        .dataSelect {
            border: 1px solid #d2d2d2;
            box-shadow: 0 2px 4px rgba(0, 0, 0, .12);
            background-color: #fff;
            color: #666;
            /* width: 250px; */
            height: 230px;
            position: abso
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值