Assume we have the following html structure:
Now I want to do the following:
- Search for all <div> elements with class="bbb"
- then (for each found element) go (one or more levels) upwards and search for a(nother) <div> element with class="foobar"
- If it exist then remove this <div> element with class=foobar. Otherwise do nothing
It the sample above only the second part should be removed.
How can I achieve this?
Peter