*
The moose likes HTML, CSS and JavaScript and the fly likes Firefox doesn't show background color for selected option Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Firefox doesn Watch "Firefox doesn New topic
Author

Firefox doesn't show background color for selected option

kartik reddy
Greenhorn

Joined: Dec 11, 2008
Posts: 9
I want to show color for selected option in Firefox.
Surprisingly, IE get this right. But in Firefox is failing to display color in selected option.

Here is the code:

<html>
<body>
<Select>
<option value="1" select="selected" style="color:red"> RED </option>
<option value="2" style="color:green">GREEN</option>
<option value="3" style="color:black" >Black</option>
</select>
</body>
</html>

Could anyone suggest how to proceed further?


Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
well your example show color and not background color.

To set the color of the select, you need to use some JavaScript.

http://jsbin.com/ifitic/2/

Eric
kartik reddy
Greenhorn

Joined: Dec 11, 2008
Posts: 9
Now, it is working fine in Firefox.
Thanks, Eric for your assistance on this issue.
 
jQuery in Action, 2nd edition
 
subject: Firefox doesn't show background color for selected option
 
Similar Threads
Bilingual JSP application
how to see select box options for moretha 40 pxcels
customize an option element in dropdown
Javascript search issue
show the whole content in combo box