Hi Clint,

The dt element should never be the parent of a dd. Maybe you were thinking of dl?

In that case you could select a dl that has a hidden dd descendant element this way:

$('dl:has(dd:hidden)').addClass('menu_bg').trigger('click');


--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Apr 20, 2008, at 1:36 AM, justclint wrote:



Im new to using jquery so forgive my question that is probably so simple.

Im trying to select the parent of element that contains a hidden element.

In my case I need to grab the dt that contains hidden dd's.

this is what I have but is not working:

$('dt').has('dd:hidden').addClass('menu_bg').trigger('click');

Ive also tried:

$('dd:hidden:parent').addClass('menu_bg').trigger('click');

and Ive tried many other variations but cant seem to get it.

What am I doing wrong?

Thanks in advance!

Cheers,

Clint
--
View this message in context: 
http://www.nabble.com/Im-having-trouble-with-selectors-tp16790638s27240p16790638.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.


Reply via email to