dwm-app/static/js/populateDropdown.js

11 lines
296 B
JavaScript
Raw Permalink Normal View History

2024-02-02 02:52:59 +00:00
function populateDropdown(dropdown, data) {
dropdown.innerHTML = '<option value="">All</option>';
data.forEach(item => {
const option = document.createElement("option");
option.value = item;
option.text = item;
dropdown.appendChild(option);
});
}