jquery插件中为什么要return return this.each(function() { this.id || (this.id = "ui-id-" + ++n) });

来源:学生作业学帮网 编辑:学帮网 时间:2024/06/06 15:22:15

jquery插件中为什么要return return this.each(function() { this.id || (this.id = "ui-id-" + ++n) });

为了保证链式操作,返回jquery对象,后边才可以继续使用该对象进行操作