我有这个:
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);
}
}
}
Run Code Online (Sandbox Code Playgroud)
在onkeyup我希望访问的函数内部select,但我知道它不可能存在.这样做的正确方法是什么?