zoukankan      html  css  js  c++  java
  • jquery的选择器

    基本选择器

    #id  $("#id")

    .class   $("#.class)  

    element  $("p")  选择p标签

    *           $("*")   选择所有元素

    select1,select2,select3    $("div,span,p")  选择所有div,span,p元素

    select#id.class     $("p#head")  选择含有id为head的p元素

    层次选择器

    $("div   span")   选择div元素下的所有span元素

    $("div>span")   选择div元素下的元素名是span的子元素

    $(".one+div")   选择class是one的下一个div兄弟元素(紧邻兄弟元素)

    $(".one~div")   选择class是one后面的所有div兄弟元素(所有兄弟元素)

    表单选择器

    :input     选择所有input,textarea,select,button

    :text      选择所有单行文本框

    :password  选择所有密码框

    :radio  选择所有单选框

    :checkbox   选择所有多选框

    :submit   选择所有提交按钮

    :image    选择所有图片按钮

    :reset      选择所有重置按钮

    :button     选择所有按钮

    :file           选择所有上传域

    :hidden     选择所有不可见元素

    过滤选择器

    基本过滤

    :first        选取第一个

    :last         选取最后一个

    :even       选择偶数

    :odd        选择奇数

    :eq(index)   等于

    :gt(index)    大于

    :lt(index)    小于

    :not(select)    去除选择元素

    :header    h1——h6

    :animated  选择所有正在执行的动画元素

    内容过滤

    :contains()  $("div:contains('我')")    选取包含文本“我”的div元素

    :empty       $("div:empty")         选择div空元素

    :has(select)  $("div:has('p')")   选择包含p元素的div元素

    :parent     $("div:parent")   选择有子元素的div

    可见性过滤

    :hidden

    :visible

    属性过滤

    [attribute]

    [attribute=value]

    [attribute!=value]

    [attribute^=value]

    [attribute$=value]

    [attribute*=value]

    [select1][select2][selectN]

    子元素过滤

    :nth-child()

    :first-child

    :last-child

    only-child

    表单对象属性过滤

    :enabled

    :disabled

    :checked

    :selected

  • 相关阅读:
    JVM调优之Tomcat启动参数配置及详解
    项目启动部署时报错:java.lang.NoSuchMethodError
    Springboot系列:@SpringBootApplication注解
    Tomcat下部署SpringBoot
    springboot 使用传统方式部署
    Spring Boot 学习笔记一(SpringBoot启动过程)
    Spring Boot【快速入门】
    Windows系统CPU内存网络性能统计第一篇 内存
    MinGW-w64非官方编译器集成安装包(很清楚)
    SyncML是一平台无关的信息同步标准协议集
  • 原文地址:https://www.cnblogs.com/fslnet/p/2794468.html
Copyright © 2011-2022 走看看