菜单切换
FACESOHO知行者
心灵
记录
远方
赞赏工具
源代码:
点击运行
保存
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>小鸟启蒙(facesoho.com)</title> <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("div:has(p,span,li)").css("border","solid red"); }); </script> </head> <body> <div> <p> div 中的 p 元素 <span>这是 span 元素</span> </p> <li>div 中的列表项</li> </div><br> <div>这个 div 元素没有 p, span 或 li 元素。</div> </body> </html>
运行结果