From the topic - "jQuery - setting the selected value of a select control via its text description" - I'm using this to select my value
$("#PersonList option").filter(function() {
return $(this).val() == <?php $PHPUser ?>;
}).attr('selected', true);
But what if I also want to STYLE it with yellow AND change the text.
I could repeat as needed.. but that seems over-coding...
ADD YELLOW:
$("#PersonList option").filter(function() {
return $(this).val() == <?php $PHPUser ?>;
}).addClass(UserAccent);
ADD TEXT:
$("#PersonList option").filter(function() {
return $(this).val() == <?php $PHPUser ?>;
}).innerText('Myself: ' + $PHPUser);
How would I do this in one evaluation?