RUNOOB.COM
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="https://cdn.staticfile.org/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.runoob.com</p> </div> </body> </html>
运行结果