首页 > 其他 > 详细

input 监听输入事件

时间:2018-08-07 14:46:54      阅读:114      评论:0      收藏:0      [点我收藏+]
$("#" + 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();
                    }
                }
            })

  

input 监听输入事件

原文:https://www.cnblogs.com/liuqiyun/p/9436624.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!