I am trying to achieve a specific effect where the text is uppercase only on the selected option within a <select>
element. I came across a solution using jQuery in this article, but I need to convert it to plain JavaScript (vanilla JS).
I have made progress and managed to make the selected value uppercase when an option is chosen. However, the issue arises when selecting another option as the previous one remains uppercase too.
I am struggling with changing the logic to "Capitalise all options EXCEPT the selected option, which I would like to be uppercase".
Any help or advice on how to achieve this would be greatly appreciated.
You can view my current progress in this working Fiddle: Here is a working Fiddle of where I am so far.