title: How to remove class and add another class jquery
body: <p>I want to remove the existing class of my element every time I click the image.</p>
  
  <p>This is my HTML:</p>
  
  <pre><code>  &lt;img id="Iphone" src="Image/Technology/Iphone.png" class="technologyImage"/&gt;
    &lt;img id="Android" src="Image/Technology/Android.png" class="technologyImage"/&gt;
  </code></pre>
  
  <p>and this is my javascript:</p>
  
  <pre><code> $(".technologyImage").click(function () {
      $(this).removeClass();
      $(this).addClass("technologySelected");
      $(".technologyImage").css("opacity", "0.4");
      $(".technologyImage").css("filter", "alpha(opacity=40)");
  });
  
  
  $(".technologySelected").click(function () {
      alert("IMAGE IS ALREADY SELECTED");
  });
  </code></pre>
  
  <p>I want to alert the user, if the user click the selected image. The code is not working, everytime I click the image it also go to the <code>$(".technologyImage")</code> not on the <code>$(".technologySelected")</code>.</p>