Working with jQuery Collections
<p>I'm trying to increase my understanding of jQuery. Please consider the following code.</p>

<pre><code>if ($('.myClass').data('id') == '123') {
}
</code></pre>

<p>How does this work? It looks simple enough until you understand that <code>$()</code> returns a collection of elements. So what does the code above do exactly? How does it make sense to compare the value of the data-id attribute for a <em>collection</em> of elements like this?</p>

<p>(I understand I can use <code>each()</code> to explicitly test each element in the collection. My question is about what the code above does.)</p>
