title: Changing image with jQuery based upon hasClass
body: <p>I am piggy-backing off of <a href="https://stackoverflow.com/questions/540349/change-the-image-source-using-jquery">this question</a>, and would like to use this technique within an event handler that looks for a 'has class'.</p>
  
  <p>The goal is to have this in a menu bar with icons/images.</p>
  
  <p>So far, I am not able to find the bug in the following code:</p>
  
  <pre><code>$('.className').click(function(){
      $('.className').removeClass('activeDesignation');
      $(this).addClass('activeDesignation');
      if ( $('.className').hasClass('activeDesignation')){
              $(this).attr("src").replace(".png", "[suffix].png");
      };
  });
  </code></pre>
  
  <p>The general Syntax appears to be ok, since the following works:</p>
  
  <pre><code>$('.className').click(function(){
      $('.className').removeClass('activeDesignation');
      $(this).addClass('activeDesignation');
      if ( $('.className').hasClass('activeDesignation')){
              $(this).hide('slow');
      };
  });
  </code></pre>
  
  <p>Just at a loss here</p>