摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>jquery基础语法</ti
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>jquery基础语法</title> <script style="text/javascript" src="jquery-3.3.1.min.js"></script> <!--jquery 引入--> <style> div{ width: 100px; height: 100px; background-color: #00a0e9; } </style> </head> <body> <div> </div> <button id="ss">显示</button> <button id="yy">隐藏</button> <script> $(document).ready(function () { /*文档就绪函数 */ $('#yy').click(function () { /*选择id为yy 的*/ $('div').hide(); }); $('#ss').click(function () { /*选择id为ss 的*/ $('div').show(); }); }) </script> </body> </html>