jQuery选择器

作者: 小7丁 | 来源:发表于2018-08-02 18:00 被阅读5次

一、jQuery 1.x 版本和 2.x 版本有什么区别?

jQuery 1.x 版本代码更老一些,兼容ie6,7,8
2.x代码更精简一些,体积更小一些,只兼容到ie9

二、介绍 jQuery 常见的选择器,以及以下 api 的用法,给出范例

.eq
.next / .prev
.nextAll / .prevAll
.siblings
.parent / .parents
.children / .find
.filter
.has
.is

<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-2.1.1.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <div class="container">
    <div class="test1">1</div>
    <div class="test2">2</div>
    <div class="test3">3</div>
  </div>
</body>
</html>

.eq

image

.next / .prev

image

.nextAll / .prevAll

image

.siblings

image

.parent /.parents

image

.children / .find

image

.filter

image

.is

image

.has

image

三、使用 jQuery 实现 Tab 切换效果

demo

四、使用 原生 js 实现 Tab 切换效果

demo

相关文章

  • jquery选择器书目录

    jquery选择器-基本选择器 jquery选择器-层级选择器 jquery选择器-基本过滤选择器 jquery选...

  • JQUERY一

    jQuery 元素选择器 jQuery 属性选择器 jQuery CSS 选择器 jQuery 事件 jQuery...

  • jQuser有选择器

    jQuery基本选择器 jQuery过滤选择器 jQuery层级选择器 jQuery筛选选择器(方法)

  • 选择器

    jQuery 元素选择器 jQuery 属性选择器 jQuery CSS 选择器

  • jQuery 基础

    jQuery jQuery操作DOM jQuery的选择器 基本选择器 层级选择器 过滤选择器 jQuery操作样...

  • jQuery

    jQuery jQuery操作DOM jQuery的选择器 基本选择器 层级选择器 过滤选择器 jQuery操作样...

  • jQuery选择器

    一、jQuery常用选择器 二、jQuery选择器优势 三、jQuery常用基本选择器 四、jQuery常用层次选...

  • JQuery基础知识

    jQuery操作DOM jQuery的选择器 基本选择器 层级选择器 过滤选择器 jQuery操作样式 css操作...

  • jQuery相关知识

    1、什么是jQuery选择器? jQuery选择器

  • jQuery选择器

    jQuery选择器 jQuery选择器完全继承了CSS的风格。学会使用选择器是学习jQuery的基础,jQuery...

网友评论

    本文标题:jQuery选择器

    本文链接:https://www.haomeiwen.com/subject/mxusvftx.html