【layui】lay.each后laydate中change获取dom设值

layui.use(['form', 'laydate'], function () {
    var form = layui.form;
    var laydate = layui.laydate;
    lay('.yearClass').each(function () {
        laydate.render({
            elem: this,
            showBottom: false,
            position: 'fixed',
            trigger: 'click',
            type: 'year',
            change: function (value, date, endDate) {
                $(this.elem).val(value);
                $('.layui-laydate').remove();
            }
        });
    });
    form.render();
});

猜你喜欢

转载自www.cnblogs.com/xiaostudy/p/12531826.html
今日推荐