title: How to add variable inside jQuery selector
body: <p>Good Day</p>
  
  <p>I want to add a variable into a jQuery selector, but the syntax is wrong:</p>
  
  <pre><code>var c = $(this).attr('class');
  
              if ($('#articleThumb ul li img').hasClass(c)) {
                  $('#articleThumb ul li img.'+c').clone().appendTo('#articleFeatured');
              }
  </code></pre>
  
  <p>the class </p>
  
  <p><strong>img.class</strong> is a variable and not a constant like <strong>img.birds</strong> for example...</p>
  
  <p>Thank you</p>