<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <div id="panel"> <h5 class="head">什么是jQuery?</h5> <div class="content"> jQuery是javascript库 </div> </div> <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script> <script type="text/javascript"> $(function () { //debugger; $("#panel h5.head").toggle( function () { $(this).next().hide(); }, function () { $(this).next().show(); } ) }) </script> </body> </html>
转载于:https://www.cnblogs.com/chrisghb8812/p/5623600.html