jquery Add and Remove Classes?
<p>I need a script that adds a 2 to the end of a class in a div with the id .sideboxtopleft on clicking of a link with the id of posts.</p>

<pre><code>&lt;script&gt;
    $(".posts").click(function () {
      if ($('.sideboxtopleft').is('#sideboxtopleft2')) {
          $('.sideboxtopleft').removeClass('2');
      }
      else{
          $('.sideboxtopleft').addClass('2');
      }
    });
&lt;/script&gt;

&lt;div id="sideboxtopleft" class="sideboxtopleft"&gt;
&lt;a href="#post" id="posts"&gt;&lt;h3&gt;RECENT POSTS &lt;div id="arrow" class="arrow"&gt;&lt;/div&gt;&lt;/h3&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div id="sideboxtopright" class="sideboxtopright"&gt;
&lt;a href="#comments" id="comments"&gt;&lt;h3&gt;RECENT COMMENTS &lt;div id="arrow" class="arrow2"&gt;&lt;/div&gt;&lt;/h3&gt;&lt;/a&gt;
&lt;/div&gt;
</code></pre>

<p>However it doesn't seem to want to work properly. Any help?</p>
