Is there a way to dynamically modify the color (background and text) of a single select menu in jQuery Mobile, without impacting other elements with the same class? I've experimented with various approaches, such as:
$('#select').css({color:#000});
and
$('#select').removeClass('ui-btn-up-a').addClass('custom-class');
I have also attempted to include a refresh afterwards without success:
$('#select').selectmenu('refresh');
I am aiming to change the color depending on the selected value, therefore I am inserting the code within the change event of the select menu like this
$("#select").live("change", function(event, ui) {
...
}
Below is my HTML structure:
<select name="select" id="select">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
Any assistance in changing the text or background color would be greatly appreciated!