Is there a shorter way to write this Jquery code?
<p>If I need to preselect a dropdown option with a certain value, I can use this:</p>

<pre><code>$('select option[value="123"]').attr('selected', 'selected');
</code></pre>

<p>but if I need to preselect an option based on the text it contains I need to do all this:</p>

<pre><code>        $('select option').each(function() {
            var $this = $(this);
            if($this.text() == 'My Text') {
                $this.attr('selected', 'selected');
            }
        });
</code></pre>

<p>Is there a way to do it without looping through all the option tags like the first way but based on text instead of value?</p>
