Sometimes, we want to hide a option in a select menu with CSS.
In this article, we’ll look at how to hide a option in a select menu with CSS.
How to hide a option in a select menu with CSS?
To hide a option in a select menu with CSS, we can add the hidden
attribute to the option element we want to hide.
For instance, we write
<select>
<option>Option1</option>
<option>Option2</option>
<option hidden>Hidden Option</option>
</select>
to hide the last option by adding the hidden
attribute to the last option element.
Conclusion
To hide a option in a select menu with CSS, we can add the hidden
attribute to the option element we want to hide.