一.任務需求:兩個按鈕,一個DIV,點擊顯示按鈕顯示DIV,點擊隱藏按鈕,隱藏DIV,
二.任務分析:監聽按鈕的點擊,操作DIV的顯示隱藏效果,
三.代碼實作:
<body><button id="go_show">顯示</button><button id="go_hide">隱藏</button><div style="height: 150px;width: 150px;background: coral;margin-top: 20px;" id="content"></div><script src="jquery-3.4.1.min.js"></script><script> $("#go_show").click(function () { $("#content").show(); }); $("#go_hide").click(function () { $("#content").hide(); })</script></body>
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/39130.html
標籤:jQuery
上一篇:jQuery——超鏈接提示
下一篇:滑鼠懸浮事件
