And as a side note, IDs should already be unique on a page. If they're not, then you're going to encounter unexpected issues in your code.
Andy matthews -----Original Message----- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Andy Matthews Sent: Thursday, June 11, 2009 2:19 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Get all unique class names This should get you started: var $allID = $('*[id!=]'); It returns a jQuery object containing all elements that have an id attribute that is not empty. Tested with the following HTML: <div id="something"> <h1 id="else">something else</h1> <p>this is some text right here</p> </div> <img id="another" /> It returns an array: [div#something, h1#else, img#another] andy -----Original Message----- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of David Sent: Thursday, June 11, 2009 9:02 AM To: jQuery (English) Subject: [jQuery] Get all unique class names I'm interested in getting an array of unique class names of all option tags under a specific select element. I'm imagining something like this (which does not do what I want): $ ( '#select_id option.class' ); What's the correct way to do this using jQuery? Thanks!