内访问JavaScript类变量我有这样的:一类功能
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'作为第三你的功能线。 – Blazemonger