本月没怎么写博客 还是发一篇吧
html页面:
<div class="layui-form-item"> <div class="layui-inline"> <label class="layui-form-label">质保起算:</label> <div class="layui-input-inline" style="width: 200px;"> <input type="text" id="tr_start" class="layui-input"> </div> <label class="layui-form-label">质保期限:</label> <div class="layui-input-inline" style="width: 200px;"> <input type="text" id="tr_endtime" class="layui-input"> </div> </div> </div>
Js代码:
layui.use(['layer', 'laydate'], function () { var laydate = layui.laydate; laydate.render({ elem: '#tr_start', theme: 'grid', showBottom: false, max: $("#tr_endtime").val() }); laydate.render({ elem: '#tr_endtime', theme: 'grid', showBottom: false, min: $("#tr_start").val() }); });
效果: