Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
195
rated 0 times [  197] [ 2]  / answers: 1 / hits: 20188  / 10 Years ago, fri, august 8, 2014, 12:00:00

I would like to add span before text inside <option> tag and style it (it should represent color in select menu). However it does't seem to work...



How to make this piece of code working?



JsFiddle: http://jsfiddle.net/bartuz/08e0L9j2/2/



It seems example above does work in Firefox only... what about other browsers?


More From » html

 Answers
17

This will depend on your web browser. In the latest version of Firefox, it works fine. However, it doesn't work in the latest version of Internet Explorer.



Your question is a bit loaded - and I suspect that's why it got downvoted - you are asking why it's not working, rather than how to get it to work.



It's not working because it's not really a supported feature of selectboxes (yet!)



I'd suggest you look into using JavaScript to achieve the same result (and specifically, the jQuery UI selectmenu) which should support this type of 'advanced' select box.


[#69861] Wednesday, August 6, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
terrence

Total Points: 120
Total Questions: 115
Total Answers: 87

Location: England
Member since Fri, May 22, 2020
4 Years ago
terrence questions
Sat, Jun 5, 21, 00:00, 3 Years ago
Wed, Jun 17, 20, 00:00, 4 Years ago
;