I would like to show/hide elements inside a div block. A similar post showed me how, but I can't make the links inside the div block work properly.
The div block:
<div class="collapse" tabindex="1">
<h1> Test </h1>
<p><a href="www.google.com">link</a></p>
<p>some other text</p>
</div>
The CSS part:
.collapse > * + *{
display:none;
}
.collapse:focus > * + *{
display:block;
}
Here is a JSFiddle of my script.
Basically, as I click on the link, the div block collapse. Do you know how can I fix this? Thanks!!