School Commit Init
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
function filterOptions() {
|
||||
var value = document.getElementById("editable-combo-box").value;
|
||||
var select = document.getElementById("dropdown");
|
||||
if(select === null) {
|
||||
return;
|
||||
}
|
||||
var options = select.options;
|
||||
for (var i = 0; i < options.length; i++) {
|
||||
if (options[i].value.toLowerCase().indexOf(value.toLowerCase()) !== -1) {
|
||||
options[i].style.display = "";
|
||||
} else {
|
||||
options[i].style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Event listener to update input field when option is selected
|
||||
document.getElementById("dropdown").addEventListener("change", function() {
|
||||
document.getElementById("editable-combo-box").value = this.value;
|
||||
});
|
||||
|
||||
document.getElementById("editable-combo-box").addEventListener("input", ()=> {filterOptions()});
|
||||
Reference in New Issue
Block a user