How do I do this in Jquery? It's about classes and adding someting to the tag
<pre><code>&lt;script type="text/javascript"&gt;
var Average_rating = a number between 1 and 5
&lt;/script&gt;
&lt;select name="rate"&gt;
         &lt;option value="1" class="p_rating_star" /&gt;Not so great&lt;/option&gt;
         &lt;option value="2" class="p_rating_star" /&gt;Quite good&lt;/option&gt;
         &lt;option value="3" class="p_rating_star" /&gt;Good&lt;/option&gt;
         &lt;option value="4" class="p_rating_star" /&gt;Great!&lt;/option&gt;
         &lt;option value="5" class="p_rating_star" /&gt;Excellent!&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>I am building a rating system.</p>

<p>How do I use JQuery to add <strong>"selected = selected"</strong>  to one of the option values, depending on the average_rating?</p>

<p>How can I say...</p>

<pre><code>Add "selected = selected" to anything with class "p_rating_star" where average_rating = that class's value (1-5)?
</code></pre>

<p>Thanks!</p>
