Select JQuery elements that have some value set by data()
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2891452/jquery-data-selector">jquery data selector</a>  </p>
</blockquote>



<p>I have several elements with class 'connection_name'.  Each one of these elements has a unique id bound to it using the data() JQuery function.  I'm trying to query to find the element with a given id, but I can't seem to get it to work.</p>

<p>For the sake of this test, I created a page with only 1 element, and set the id of the element.</p>

<p>I can verify that the id is being set, as when I query the element in the console, it shows the id returned:</p>

<pre><code>$('.connection_name').data()
  Object
  id: "4fea76bd99ea080d19000002"
  __proto__: Object
</code></pre>

<p>I've read on other questsions/posts that the element should be selected by $('selector[data-attribute=value]'), but that doesn't seem to work:</p>

<pre><code>$('.connection_name[data-id="4fea76bd99ea080d19000002"]')
[]
</code></pre>

<p>Worse than that, even when I try to select it without any value (just by the attribute), I still return nothing:</p>

<pre><code>$('.connection_name[data-id]')
[]
</code></pre>

<p>I'm not sure what the issue is, or how to go about doing this.</p>
