I am trying to figure out how to add the name for my dropdown value, which by default is empty. I would like to call it 'Show all' instead. It works with map filters, so it displays the values by function.
function buildDropDownList(title, listItems) {
const filtersDiv = document.getElementById("filters");
const mainDiv = document.createElement("div2");
const filterTitle = document.createElement("h3");
filterTitle.innerText = title;
filterTitle.classList.add("py12", "txt-bold");
mainDiv.appendChild(filterTitle);
const selectContainer = document.createElement("div2");
selectContainer.classList.add("select-container", "center");
const dropDown = document.createElement("select");
dropDown.classList.add("select", "filter-option");
const selectArrow = document.createElement("div2");
selectArrow.classList.add("select-arrow");
const firstOption = document.createElement("option");
dropDown.appendChild(firstOption);
selectContainer.appendChild(dropDown);
selectContainer.appendChild(selectArrow);
mainDiv.appendChild(selectContainer);
for (let i = 0; i < listItems.length; i++) {
const opt = listItems[i];
const el1 = document.createElement("option");
el1.textContent = opt;
el1.value = opt;
dropDown.appendChild(el1);
filtersDiv.appendChild(mainDiv);
}