I am trying to use values of options of dropdown menu in my loop, but i get uncaught error, all is undefined in filter1.
function filter1() {
var x = document.getElementById("filter1").value;
switch(x) {
case all:
getElementsByClassName("1").style.display="none";
break;
}
console.log(x);
}
HTML:
<select id="filter1" name="country" onchange="filter1()">
<option value="all">All countries</option>
</select>
case "all"Notice the quotes .