First of all, this is a pretty – well – “uncommon” way to do it. Secondly, try to style the
option elements rather than the select. And try to
separate function and style a little more. For example, don’t change CSS with JavaScript, use JS to add a class to the element and style that class with CSS in the stylesheet.
So, for example:
Code:
function clearSelect(thisfield, id) {
$j("#" + id).addClass('cleared');
}
Code:
.cleared {
background-color: #FFF;
border: 1px solid #CCCCCC;
color: #000;
}
/* to style the option elements you can use .cleared option {…} */