title: Get html value from object within an array
body: <p>I have an exemplary JavaScript code snippet. What I'm trying to achieve here is getting html, and id attribute value from an object within the array</p>
  
  <pre><code>var swatches = $(".swatchColor");
  for (var i = 0; i &lt; swatches.length; i++) {
       var value = parseInt(swatches[i].html());
       if (!isNaN(value)) {
           alert(swatches[i].attr("id"));
       }
  };
  </code></pre>
  
  <p>but for some reason I get Uncaught TypeError: undefined is not a function error when swatches[i].html() is executed. Why does it happen?</p>