jquery编写开关实现div的显示与隐藏

<!DOCTYPE html>
<html>
<head>
<script src="/jquery/jquery-1.11.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$("p").toggle(1000);
});
});
</script>
</head>
<body>
<button type="button">切换</button>
<p>这是一个段落。</p>
<p>这是另一个段落。</p>
</body>
</html>

相关文章:

  • 2022-12-23
  • 2021-12-23
  • 2022-03-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
猜你喜欢
  • 2021-12-18
  • 2022-01-29
  • 2022-12-23
  • 2022-02-11
  • 2022-03-09
  • 2021-11-05
相关资源
相似解决方案