I have awkward problem I cannot resolve.
I have a nested divs, which I want to show / hide when user clicks on a link. All divs at once.
I cannot assign ID’s to my divs, so I will need to do it wiht classes.
<a href="#" id="showhide">Show more</a>
<div class="more">
<div class="more1">
<h2>Some title</h2>
<p>Some text</p>
</div>
<div class="more2">
<h2>Some title</h2>
<p>Some text</p>
</div>
<div class="more3">
<h2>Some title</h2>
<p>Some text</p>
</div>
</div>
Here is the fiddle to my html structure.
http://jsfiddle.net/56jdL/1/
Thanks!
You can use first hide the div, using
css:or jQuery:
And then use
togglemethod:http://jsfiddle.net/J2YgE/