title: jQuery: Can't remove class
body: <p>I made a like / dislike script that works like this: 2 buttons with <code>rate_deal</code> class. When you click the like or dislike button it removes the <code>rate_deal</code> class from both buttons to prevent clicking again and then adds some classes to look better.</p>
  
  <p>I have a problem. I don't know what I did wrong but I can't delete the <code>rate_deal</code> class for both buttons when I click on a button.</p>
  
  <p>Here is the code:</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div class="content_r_d_left_rate" id="deal-1"&gt;
  &lt;span class="rate_deal content_r_d_l_rate_img_up"&gt;&lt;/span&gt;
  &lt;span class="rate_deal content_r_d_l_rate_img_down"&gt;&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>jQuery:</p>
  
  <pre><code>$(".rate_deal").click(function(){
  
          var dealIdRaw = $(this).parent().attr('id');
          var dealId = dealIdRaw.replace('deal-', '');
  
          $('#'+dealIdRaw).children().removeClass('rate_deal');
  
          if($(this).hasClass('content_r_d_l_rate_img_up'))
          {
              $('#'+dealIdRaw+' &gt; .content_r_d_l_rate_img_down').addClass('content_r_d_l_rate_img_down_i');
              $('#'+dealIdRaw+' &gt; .content_r_d_l_rate_img_down').removeClass('content_r_d_l_rate_img_down');
          }
          else
          {
              $('#'+dealIdRaw+' &gt; .content_r_d_l_rate_img_up').addClass('content_r_d_l_rate_img_up_i');
              $('#'+dealIdRaw+' &gt; .content_r_d_l_rate_img_up').removeClass('content_r_d_l_rate_img_up');
          }
      });
  </code></pre>