How to change selected item's text in a select list with jQuery
<p>In the script below, the "my_theme" element is a select list of a directory listing. </p>

<p>When its "change" event is fired, the jquery is called and triggers a "get" to find out if the selected folder has a style.css file. The get returns true/false.</p>

<p>All that works fine. I'm just trying to determine how to decorate the item in the select list depending on the outcome of the get.</p>

<p>For example, if its false, I want to make the selected item's background gray and append some text to the option name label.</p>

<p>So, if the currently selected item in the list is "alpha", and the $.get returns false, then the text should become "alpha (inactive)".</p>

<pre><code>$('#my_theme').change
(
    function() 
    {
    //check if this folder has a style.css file
    $.get('&lt;?php echo get_bloginfo('template_directory') ?&gt;/getStyle.php', {theme: myImage}, function(data){doActive(data);});
    }
);

function doActive(data){
if(active){
    //if the stylesheet is missing, append the label with " (inactive)"
    $('#my_theme :selected').text() = $('#my_theme :selected').attr('value') + ' (inactive)';
    }
</code></pre>

<p>the option's "value" attribute is the same as its label.
    }</p>
