【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();
});

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM