<!DOCTYPE html> <html> <head> <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'></script> <script> $(document).ready(function(){ $('.myButton').click(function() { var $ct = $(this).next("div.container"); if (this.value == 'collapse') { this.value = 'expand'; $ct.hide("slow"); $('.myButton').parent().show("slow"); } else { this.value = 'collapse'; $ct.show("slow"); $('.myButton').not($(this)).parent().hide("hide"); } }); }); </script> </head> <body> <?php for($i=0;$i<=3;$i++) { echo"<div class='main' style='removed:relative;border:1px solid #A5BEBE;background- color:#E7EFEF;width:84%; '> sometext:-<a href='#'>$url</a><br> sometext :$b<br> </p> <input type='button' value='expand' class='myButton' name='button1' target='".$i."' onclick='clickButton(this)' style='position:absolute;left:85%;top:4%;background:#B20000;color:white;width:70px;height:20px;font- size:15px;' >"; echo "<div class='container' style='display:none;background:white; '> sometext:-<a href='#'>$url</a><br> sometext :$b<br> sometext :$c<br> </p>"; if(isset($_GET['button1'])) { echo"<script>alert('msg1');</script>"; include('function.php'); } echo "</div>"; echo "</div>"; } ?> </body> </html>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)