【发布时间】:2011-11-03 22:18:19
【问题描述】:
我有这个:
function FilterSelect(select, search) {
this.select = select;
this.search = search;
// Get the current list options
this.options = this.select.options;
// Whenever the text of the search box changes, do this
this.search.onkeyup = function() {
// Clear the list
while(this.select.options.length > 0) {
this.select.remove(0);
}
}
}
在onkeyup 函数内部我想访问select,但我知道这是不可能的。这样做的正确方法是什么?
【问题讨论】:
-
尝试将
this.search.select = this.select添加为函数的第三行。
标签: javascript class inheritance