只有年月的输入框

今天遇到一个创建只输入年月输入框的需求,html5虽然有年月的时间控件,

type="month" name="bdaymonth">

但是面板上还有天数,用起来不太方便,所以使用了layui的一个日期插件。链接如下:http://www.layui.com/laydate/

具体步骤:

1.下载layDate插件,下载地址:http://res.layui.com/download/laydate/layDate-v5.0.5.zip?v=1
2.代码

<body>
<input type="text" id="test1">
<script src="/laydate/laydate.js">script> 
<script>
//执行一个laydate实例
laydate.render({
  elem: '#test1'
  ,type: 'month'
});
script>
body>

3.点击后的页面
只有年月的输入框_第1张图片

你可能感兴趣的:(layui)