Add class to selected option of a select element
<p>To demonstrate that I could even use a Class attribute on an option elem I tried adding class attributes to options of a select elem in a static page and that works fine. I noticed that not many online resouces documented this so I figured I would explicitly set the record.</p>

<p>here is the jquery code attempting to add a class to the selected option</p>

<pre><code> ChangeDdlItemBG : function(obj, compLev)
{
    var ddl = $(obj);
    var index = ddl.attr('selectedIndex');
    switch(compLev)
    {
        case ComplianceLevel.Compliant : 
            $(ddl.attr('id') + ': selected').addClass('Compliant');
            break;
        case ComplianceLevel.OtherThanSerious : 
            $(ddl.attr('id') + ': selected').addClass('OtherThanSerious');
            break;
        case ComplianceLevel.Serious : 
            $(ddl.attr('id') + ': selected').addClass('Serious');
            break;
        case ComplianceLevel.Critical : 
            $(ddl.attr('id') + ': selected').addClass('Critical');
            break;
    }
}

var ComplianceLevel =
{
    Compliant : function() { return 0; },
    OtherThanSerious : function() { return 1; },
    Serious : function() { return 2; },
    Critical : function() { return 3; },
};
</code></pre>

<p>New information, I found the reason nothing occured was a simple mistake in the value being passed in for compLev. However, now it runs through the code for the correct case and does nothing to the color of the item.</p>
