Edit The Code:
See Result »
Try it Yourself - ©
w3big.com
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="http://cdn.static.w3big.com/libs/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $(".ex .hide").click(function(){ $(this).parents(".ex").hide("slow"); }); }); </script> <style type="text/css"> div.ex { background-color:#e5eecc; padding:7px; border:solid 1px #c3c3c3; } </style> </head> <body> <h3>Google</h3> <div class="ex"> <button class="hide">点我隐藏</button> <p>站点名: Google<br> 站点 URL:http://www.google.com</p> </div> <h3>本教程</h3> <div class="ex"> <button class="hide">点我隐藏</button> <p>站点名: 本教程<br> 站点 URL:http://www.w3big.com</p> </div> </body> </html>