Animate multiple divs on click
I want to animate divs on click . But the problem is there are multiple divs and I unable to get the height of each div
my code is
function show (div) {
var hei = $('.a').height();
$('.show').click(function(){
$('.text').animate({'height' : hei + 'px'})
});
}
and my html is
<div class="text" style="border:2px solid #993300; width:200px; height:100px; overflow-y:hidden;">
<div class="a"> <p>sdf </p>
<p>sdf</p>
<p>sd</p>
<p>fs</p>
<p>df</p>
<p>sd</p>
<p>fs</p>
<p>df</p>
<p>sd</p>
<p>f</p>
<p>sd </p>
</div>
</div>
<div class="show" onclick="javascript:show();"><strong>Show</strong></div>
regards