Alexandre Plennevaux schrieb: > hello! > > i guess i'm not too good in finding my way upwards in the DOM tree. > > I have a structure like this: > > dl#navigation > dl#navigation > dt > dl#navigation > dd > ul > li > a.selected > > dl#navigation > dt > dl#navigation > dd > ul > li > a > > dl#navigation > dt > dl#navigation > dd > ul > li > a > > /dl > > all ul are hidden but the one containing the selected a. I need to > access that specific *dt* element. > > i tried this, but it does not work: > > $this = $("//dd[ul/li/a.selected]"); > $this.show(); > $this = $(this).parent(); > $("dt",$this).css({border: "1px solid #FF0000"}); > > > sorry, i think i 'm in need of a good tutorial on selectors. > > thank you for your help, > > Alexandre
Alexandre, try this: $("//dd[ul/li/a.selected]").prev(); I'm not sure if I understood that XPath selector correctly, but you could try: $("//dd[ul/li/a.selected] ~ dt") But I think that this one simply selects the dd element that is preceded by a dt which is the case anyway. -- Klaus _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/