Jquery if div has value1-10 add class
<p>So I am trying to build this reputation bar for my site which will solely depend only on given number. The functionality should be something like this.</p>

<p>If div has value 1-10, add <code>class="beginner"</code>
If div has value 11-20, add <code>class="mediocre"</code>
If div has value 21-30, add <code>class="hardcore"</code> 
and so on..</p>

<p>I have this:</p>

<pre><code>&lt;div&gt;&lt;a&gt;7&lt;/a&gt;&lt;/div&gt;
</code></pre>

<p>What I want is this:</p>

<pre><code>&lt;div class="beginner"&gt;&lt;a&gt;7&lt;/a&gt;&lt;/div&gt;
</code></pre>

<p>I thought I should start with something like this:</p>

<pre><code>$("div:contains('0&gt;10')").addClass("begginer");
</code></pre>

<p>but I am pretty much sure that's not going to work. Can anyone help me with this? I am pretty lost here :(</p>
