我有以下代码:
Test = function(options){
var value;
for(option in options){
value = options[option];
this[option] = value;
}
this.sbOptions = this.el.find('.ulp-layer .sbOptions');
this.hotelSelector = this.el.find('select[name="hotelname"]');
this.hotelSelector.selectbox();
console.log(this.sbOptions); // not finding the element
console.log(this.el.find('.ulp-layer .sbOptions')); // finds the element
};
var testPage = new Test({
el: $('.page')
});
我无法弄清楚为什么这两个console.log行没有返回相同的元素。你能给我一个提示吗? 谢谢!