Swap paragraph content for image using jquery
<p>I have a client who's needing a quick update, they use woocommerce and are adding a rating attribute to their products,</p>

<p>currently its set up so you can choose a rating (1-5), and it currently outputs that as paragraph text ie <code>&lt;p&gt;1&lt;/p&gt;</code></p>

<p>would it be possible with jquery, so that it replaces the text content with an image, dependant on the content, so for example if the content is "1" it replaces it with an image of 1 star, but if the content is "2" it loads an image with 2 stars etc?</p>

<p>Am trying to update this without making too many changes to the core woocommerce php, although i have updated it so that the table row which the paragraph resides within has a class, so:</p>

<pre><code>&lt;tr class="rating"&gt;
&lt;th&gt;rating&lt;/th&gt;
&lt;td&gt;&lt;p&gt;1&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
</code></pre>

<p>what i would presume is that I use jquery to change the css styling on the paragraph, so that it uses the relevant star image as the paragraph background, displays block, and indents the text so it cant be seen, but is it possible to have these styles (in particualr the background) dependant on the actual text content in the paragraph?</p>

<p>much thanks in advance!</p>
