If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

How to address <div>directly after <div class="aaa"> ?

Assume I have a code like:

....
<div class="aaa">
....
</div>
<div>
....
</div>
....

Now I want to hide from Javascript or CSS the whole <div> element which follows directly AFTER the <div class="aaa"> element.
Unfortuantely it has no id nor class name. So I must adress it relative to the precedent <div ....> element.

Now I want to hide from Javascript or CSS the whole <div> element which follows directly AFTER the <div class="aaa"> element.
Unfortuantely it has no id nor class name. So I must adress it relative to the precedent <div ....> element.

The first div element hide could be easily hidden by:

div.aaa { display: none; }

... but the second?

Be aware then all remaining <div> elements should be kept.

How can I achieve this?

You can use the node collection
to access divs relative to their
parent element like this ...