菜单切换
FACESOHO知行者
心灵
记录
远方
赞赏工具
源代码:
点击运行
保存
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $(".intro,.demo,.end").css("background-color","yellow"); }); </script> </head> <body> <h1>欢迎访问我的主页</h1> <p class="intro">这个段落的 class 为 "intro"。</p> <p>这是一个段落。</p> <p class="demo">这个段落的 class 为 "demo"。</p> <p>这是另外一个段落。</p> <p class="end">这个段落的 class 为 "end"。</p> </body> </html>
运行结果