登录  | 立即注册

游客您好!登录后享受更多精彩

微信扫一扫,关注我们

第三节:jquery在html中的引用方式

如果你点击“隐藏” 按钮,我将会消失。

代码如下:
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <script src="jquery-3.1.1.min.js">
  6. </script>
  7. <script>
  8. $(document).ready(function(){
  9. $("#hide").click(function(){
  10. $("p").hide();
  11. });
  12. $("#show").click(function(){
  13. $("p").show();
  14. });
  15. });
  16. </script>
  17. </head>
  18. <body>
  19. <p>如果你点击“隐藏” 按钮,我将会消失。</p>
  20. <button id="hide">隐藏</button>
  21. <button id="show">显示</button>
  22. </body>
  23. </html>
复制代码
回复

使用道具

关于本站|手机版|学做APP ( 蜀ICP备2022004082号 ) |蜀ICP备2022004082号-2

GMT+8, 2024-9-17 04:41 , Processed in 0.073344 second(s), 24 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

返回顶部 返回列表