show and hide dynamic div by jquery

show and hide dynamic div by jquery

<script>
$(function () {
$("a").click(function () {
var ID = this.id;
$('.'+ID).toggle();
});
});

</script>

<?php
$j=0;
while($j<=10)
{
?><p>
<a href="javascript:void(0);" id="content<?php echo $j; ?>" class="team-readmore">read more.</a>
</p>
</div>
<div style="display:none"><?php echo stripslashes($getdata[$j][7]); ?></div>

<?php
$j++;
}
?>

You may also like...