Here is another blog by request. I blogged not too long ago about using jQuery to change the default option in a listbox. As a result, a comment was added that asked me how to change the selected option using only the text, and not the value. Here is the answer! Doing this is actually quite simple, but may not be straightforward at first.
In order to demo this, we need a listbox (select, combo box, drop down list, etc.). Here is the one I am using for my example:
Just a simple drop down list, right? Right. Now, let’s use jQuery to select the default value that will show to your website visitors.
jQuery('#cboList option:contains(\'Text5\')').attr('selected', 'selected');
Text1 Text2 Text3 Text4 Text5 Text6
Now you can try this on your own!