title: I need to compare two classes in an if statement
body: <p>So I have a website with a couple of images, and this is what I want it to do...</p>
  
  <p>If somebody clicks a button with the class <code>lol</code>, <strong>and the picture currently being shown has a class name with the same value</strong> - do something.</p>
  
  <p>This is my HTML:</p>
  
  <pre><code>&lt;div class="lol"&gt;BUTTON&lt;/div&gt;
  &lt;div class="whatever"&gt;
  &lt;img src="x" class="lol"/ &gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I've styled <code>div.lol</code> and <code>img.lol</code> in my CSS.</p>
  
  <p>This is what I thought the jQuery would look like:</p>
  
  <pre><code>$(document).ready(function(){
      $('div.lol').click(function(){
          if($(this)===$('img.lol')){
              alert("LOL");
          }
      });
  });
  </code></pre>