搜索文档
首页
HTML/CSS
JavaScript
服务端开发
Java教程
移动端
数据库
当前位置:
首页
JavaScript
jQuery 教程
jQuery 效果
源代码
清空
点击运行
<!DOCTYPE html> <html> <title>jQuery Chaining链效果示例 - 基础教程(div.cn)</title> <head> <style> p { padding: 15px; background: #7F00FF; color: white; } </style> <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $("p").css("background-color", "coral").hide(2000).show(2000); }); }); </script> </head> <body> <p>这是一个段落</p> <button>点击我</button> </body> </html>
运行结果