title: If div hasClass with variable name, addClass
body: <p>I am trying to add a class to a div that has a class with a variable name.  This is the code I am using:</p>
  
  <pre><code>if ($('div').hasClass(this.filterSelection)) {
          $(this).addClass('highlightMenu');
  }
  </code></pre>
  
  <p>The 'this' isn't doing what I want it to, but I don't know what to put in its place.  Any ideas will be much appreciated.</p>