<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <title></title>
    <style>
    div {
        width: 100px;
        height: 90px;
        float: left;
        padding: 5px;
        margin: 5px;
        background-color: #EEEEEE;
    }
      .c{display:none;
      }
    </style>
    <script

src="https://www.imooc.com/static/lib/jquery/1.9.1/jquery.js"></script>
</head>

<body>  
  <div id="aaron">
     <p>id="aaron"</p>
     <p>选中</p>
    </div>
    <div class="imooc">
        <p>id="imooc"</p>
        <p>jQuery选中</p>
    </div>
    <div class="left imooc" title = "empty测试" id="cs"></div>
    <div class="c">测试隐藏</div>
    <div class="div">
    <input type="radio" name="dan"/> 单选</input><br>
    <input type="radio" name="dan"/> dan</input>
    </div>
    <script type="text/javascript">
       //通过原生方法处理
        var div = document.getElementById('aaron');
        div.style.border = "3px solid blue";
    </script>

<script type="text/javascript">
     //通过jQuery直接传入id
     //id的唯一,只选择到了第一个匹配的id为imooc的div节点
        $(".imooc:contains(jQuery选中)").css("border", "3px solid red");<!--元素

(标签)内空格都不允许存在-->
    </script>
    <script type="text/javascript">
      $(".imooc:empty").css("border-left","3px dotted #00ffff");
      $(".imooc:empty").css("border-right","3px dotted red");
      $(".imooc>p:first-child").css("border","5px solid yellow");
      $("#cs").css("border-bottom","5px solid blue");
      $(".c:hidden").css("border","5px solid blue");
      $(".div>input:first-child").css("border","5px solid blue");
  </script>
</body>

</html>

jQuery筛选选择器的更多相关文章

  1. jquery-5 jQuery筛选选择器

    jquery-5  jQuery筛选选择器 一.总结 一句话总结:选择器加动态添加方法可以不用想方法名,这个简单方便. 1.筛选选择器有哪三种? 过滤 查找 串联 1.过滤 eq();first(); ...

  2. Jquery 筛选选择器

    筛选选择器(方法) 既然是方法 那就应该对象调用   obj.metch(); $(“.dd”).children("ul"),show();           //找到.dd下 ...

  3. jQuery的筛选选择器

    基本筛选选择器 很多时候我们不能直接通过基本选择器与层级选择器找到我们想要的元素,为此jQuery提供了一系列的筛选选择器用来更快捷的找到所需的DOM元素.筛选选择器很多都不是CSS的规范,而是jQu ...

  4. jQuery选择器之表单对象属性筛选选择器

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content ...

  5. jQuery选择器之属性筛选选择器

    在这么多属性选择器中[attr="value"]和[attr*="value"]是最实用的 [attr="value"]能帮我们定位不同类型 ...

  6. jQuery---jq基础了解(语法,特性),JQ和JS的区别对比,JQ和JS相互转换,Jquery的选择器(基础选择器,层级选择器,属性选择器),Jquery的筛选器(基本筛选器,表单筛选器),Jquery筛选方法

    jQuery---jq基础了解(语法,特性),JQ和JS的区别对比,JQ和JS相互转换,Jquery的选择器(基础选择器,层级选择器,属性选择器),Jquery的筛选器(基本筛选器,表单筛选器),Jq ...

  7. jquery 表单对象属性筛选选择器

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content ...

  8. jquery 子元素筛选选择器

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content ...

  9. jquery 属性筛选选择器

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content ...

随机推荐

  1. 在ActiveMQ中使用SingleConnectionFactory遇到的坑

    我们在生产环境使用了ActiveMQ作为消息中间件,消息中间件连接到数据库对消息进行持久化. 最近发生了一个奇怪的事情,消费者端的生产日志总是报如下错误: The JMS connection has ...

  2. 交叉编译参数--build、host和target的区别

    build.host和target 在交叉编译中比较 常见 的一些参数就是build.host和target了,正确的理解这三者的含义对于交叉编译是非常重要的,下面就此进行解释 --build=编译该 ...

  3. Java数组学习之前基础小案例

    不多说,1天时间看完数组之前内容,这就靠代码的实践总结一下吧~~ 打印三角形 简单易懂,初学都会,就不注释了,前者为取巧的三角形实现方法,我注释了,直接上源码~~ public class Trian ...

  4. [刷题] 104 Maximum Depth of Binary Tree

    要求 求一棵二叉树的最高深度 思路 递归地求左右子树的最高深度 实现 1 Definition for a binary tree node. 2 struct TreeNode { 3 int va ...

  5. [Java] 部署到Linux

    阿里云 控制台->云服务器ECS->实例->创建实例 计费方式 地域 网络 安全组:默认安全组 公网IP地址:分配 实例 公网带宽:1M ECS服务器:公共镜像CentOS 存储 购 ...

  6. ltp

    1.查找文件 find / -name 'filename'   1 2.查找目录 find / -name 'path' -type d 1 3.查找内容 # find .| xargs grep ...

  7. tar cf XXX.tar /tmp /var 日志保存

    tar cf XXX.tar /tmp /var 检测tar tf XXX.tar /tmp /var  

  8. Hive 默认分隔符

    引言 Hive 中的默认分隔符是 ^A (\001) ,这是一种特殊的分隔符,使用的是 ASCII 编码的值,键盘是打不出来的 查看 Hive 默认分隔符文件 Linux 上的文件 以 \001 作为 ...

  9. cnetos 网卡绑定 eth0+eth1做双网卡绑定到bond0

    1.网卡绑定:eth0+eth1做双网卡绑定到bond0 二.网络配置 网卡绑定1./etc/sysconfig/network-scripts/目录下建立ifcfg-bond0文件,内容如下DEVI ...

  10. [leetcode] 874. 行走机器人模拟(周赛)

    874. 行走机器人模拟 模拟 描述方向时有个技巧:int[][] dx = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}}; 分别存储机器人向上.右.下.左走时,坐标应该如何变 ...