input 监听输入事件


$("#" + inputId).on("input", function () {
                var checkboxId = $("#" + inputId).attr("target");
                if ($("#" + inputId).val().length == 0) {
                    //关闭复选框
                    if ($("#" + checkboxId).next().hasClass("layui-form-checked"))
                    {
                        $("#" + checkboxId).next().click();
                    }
                } else {
                    //开启复选框
                    if (!$("#" + checkboxId).next().hasClass("layui-form-checked")) {
                        $("#" + checkboxId).next().click();
                    }
                }
            })

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM