源代碼
點擊運行
<!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(){ $("button").click(function(){ $("p").hide("slow",function(){ alert("段落現在被隱藏了"); }); }); }); </script> </head> <body> <button>隱藏</button> <p>我們段落內容,點擊“隱藏”按鈕我就會消失</p> </body> </html>
運行結果