title: Object #<HTMLDivElement> as jQuery object
body: <p>How can I get a <code>#&lt;HTMLDivElement&gt;</code> as a jQuery object?</p>
  
  <p>I need to do the following: I have a list of div's with the class contents. So I iterate over it until I find the one with the additional class: "test"</p>
  
  <p>here is my code:</p>
  
  <pre><code>$.each( $(".contents"), function( key, value ) {
      if (value.hasClass("test"))
      {
          alert("got it");
      }
  });
  </code></pre>
  
  <p>I'm getting the exception: <code>Uncaught TypeError: Object #&lt;HTMLDivElement&gt; has no method 'hasClass'</code> </p>