Please I need help in hiding particular options from select tag based on a particular condition with javascript and class. Here is my code
<select>
<option class="dis">Cat</b></option>
<option class="dis">Dog</option>
<option class="dis">Snake</option>
<option class="dis">Ostrich</option>
<option class="dis">Lion</option>
</select>
Here is the Javascript
var elements = document.getElementsByClassName("dis");
doIt(elements, false);
function doIt(elements, status) {
for (var i = 0; i < elements.length; i++) {
elements[i].disabled = status;
}
}
Using classes and arrays how can I hide the above options instead of disabling them?