I want to change select option background without expand block.
If I code like "background: ‘red’", it will change all background includes of expand block.
How can I solve it?
Question posted in Javascript
A very good W3school tutorial can be found here.
A very good W3school tutorial can be found here.
2
Answers
To change the background color of the select options without affecting the expanded block, you can use the option selector in CSS. Here’s an example:
You’ll need to create a class with a name "active" or something similar, and then first remove the it class name from all nodes on click, and finally apply it to the node that you actually want.