title: Filter element stored in variable by class
body: <p>I have an elements stored in a variable (var body). These elements take the form of:</p>
  
  <pre><code>&lt;p class='txt'&gt;&lt;/p&gt; or &lt;p class='img'&gt;&lt;/p&gt; 
  </code></pre>
  
  <p>I would like pass 'body' into a function and only return the element passed into it if its class is 'img'.</p>