I'm not an expert either, so I may be wrong. But I doubt that BrCU really gives you what you want. find("a:first") will give you ONE element by definition... it will not return an array of elements. I think. Probably you need to do something like this: var el = ""; var BrCu = here.parents('li'); BrCu.each(function () { el = $(this).find("a:first"); bc += ">"+el; });
This will probably not work straight off... but now bc will hold all of the a elements... On 26 Sep, 11:44, Geir <gso...@frisurf.no> wrote: > Hi! > I'm not an expert in js, maybe you can help me with this one: > > var BrCu = here.parents('li').find("a:first"); > for (i=3; i=0; i--){ > if (BrCU[i] != undefined){ > $('#breadcumb span.ins').html('>' + BrCu[i]); > } > }; > > BrCu gives me what I want. But the for-loop is not writing anything to > the page. > Have I misunderstood something? > > var here is current location in a navigation-menu (ul li a ul li a ..) > > Thanks!