First of all, you need to fix your HTML. An anchor is an inline
element and may not contain div, p etc. This may give you unexpected
results cross-browser and scripting on top of an invalid DOM is not a
good idea to begin with.

--Klaus


On 19 Jan., 12:11, Christoph Neymeyr <christ...@uddebo.net> wrote:
> Hi,
>
> I have a situation where I have an image with a specific class. I need
> to find the <a>-tags surrounding this items class, but could not make
> is, as I have different situations that are totally dynamic -
> unfortunately.
>
> <a href="..."><div><div><div><p><img class="thisClass"></p></div></
> div></div></a>
>
> and
>
> <a href="..."><b><img class="thisClass"><br>caption</b></a>
>
> Anybody knows of a good idea on how to select the surrounding <a>-tags
> of all items with class="thisClass"?
>
> Thanks a lot - this made me headache...
>
> Christoph, using 1.2.6

Reply via email to