Tuesday, 30 August 2011

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 class="content<?php echo $j; ?>"  style="display:none"><?php echo stripslashes($getdata[$j][7]); ?></div>
<?php
$j++;
}
?>