Possible Duplicate:
jquery data selector
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.
For the sake of this test, I created a page with only 1 element, and set the id of the element.
I can verify that the id is being set, as when I query the element in the console, it shows the id returned:
$('.connection_name').data()
Object
id: "4fea76bd99ea080d19000002"
__proto__: Object
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:
$('.connection_name[data-id="4fea76bd99ea080d19000002"]')
[]
Worse than that, even when I try to select it without any value (just by the attribute), I still return nothing:
$('.connection_name[data-id]')
[]
I'm not sure what the issue is, or how to go about doing this.