<!DOCTYPEhtml><html><head><metacharset="UTF-8"><title>Insert title here</title><scripttype="text/javascript"src="../js/jquery-3.3.1.min.js"></script><script>//隐藏divfunctionhideFn(){$("#showDiv").hide("slow","swing",function(){alert("隐藏了...")})}//显示divfunctionshowFn(){$("#showDiv").show("slow","swing",function(){alert("显示了...")})}//切换显示和隐藏divfunctiontoggleFn(){$("#showDiv").toggle("slow");}</script></head><body><inputtype="button"value="点击按钮隐藏div"onclick="hideFn()"><inputtype="button"value="点击按钮显示div"onclick="showFn()"><inputtype="button"value="点击按钮切换div显示和隐藏"onclick="toggleFn()"><divid="showDiv"style="width:300px;height:300px;background:pink">
div显示和隐藏
</div></body></html>