使用jquery内容过滤选择器
2016-05-27 22:13
579 查看
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="Generator" content="EditPlus®"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <title>使用jquery内容过滤选择器</title> <script src="jquery-1.8.0.js"></script> </head> <style type="text/css"> body{ font-size:12px; text-align;center; } div{ float:left; border:solid 1px #ccc; margin:8px; width:65px; height:65px; display:none; } span{ float:left; border:solid 1px #ccc; margin:8px; width:45px; height:45px; background-color:#eee; } </style> <script type="text/javascript"> /* $(function(){ $("div:contains('A')").css("display","block"); }); $(function(){ $("div:empty").css("display","block"); }); $(function(){ $("div:has(span)").css("display","block"); }); */ $(function(){ $("div:parent").css("display","block"); }); </script> <body> <div>ABCD</div> <div><span></span></div> <div>EFaH</div> <div></div> </body> </html>
相关文章推荐
- 使用Jquery基本过滤选择器
- 使用Jquery层次选择器
- 使用Jquery基本选择器
- js、Jquery代码检测页面
- 使用JQuery实现隔行变色
- Jquery控制DOM对象
- jquery的链式写法
- JQuery开发4-当网页内容大于一页时提示返回顶部
- 读jQuery源码释疑笔记3
- jQuery工具方法
- jQuery实现3D幻灯片
- jQuery自定义函数
- jquery动画效果总结
- jquery的each()详细介绍
- 标准Jquery Ajax
- 使用jquery获取url以及jquery获取url参数的方法
- jQuery的deferred对象详解
- jquery选项卡切换
- JQ验证表单
- jquery动态添加数据,实现“推荐产品模块”功能