美文网首页
jquery 的选择器

jquery 的选择器

作者: 宏_4491 | 来源:发表于2020-07-20 09:34 被阅读0次

一、获取祖先级元素

1、parent(selector):返回直接父元素,可选择过滤。
2、parents(selector):返回祖先元素,包括父元素,可选择过滤。
3、closest(selector):返回第一个祖先元素(祖先是父、祖父、曾祖父,依此类推。),从当前元素开始沿 DOM 树向上,可选择过滤。

二、获取兄弟级元素

1、next(selector):返回下一个同胞元素,可选择过滤。
2、nextAll(selector): 返回后面的所有同胞元素,可选择过滤。
3、prev(selector):返回上一个同胞元素(与next相反),可选择过滤。
4、prevAll(selector):返回前面的所有同胞元素(与nextAll相反),可选择过滤。
5、siblings(selector):返回所有同胞元素,不分前后,可选择过滤。

三、获取子孙级元素

1、children(selector):返回直接子元素,可选择过滤。
2、find(selector):返回当前元素的后代,可选择过滤。
3、contents():返回直接子元素,包括被选元素的文本和注释节点。该方法与 children() 方法类似,不同的是它返回的是文本和注释节点。如果在相同的域中,contents() 方法也能访问 iframe 的 HTML。

其他:

1、filter(selector):返回符合一定条件的元素。

相关文章

  • jquery选择器书目录

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

  • JQUERY一

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

  • jQuser有选择器

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

  • jQuery 基础

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

  • jQuery

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

  • 选择器

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

  • JQuery基础知识

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

  • jQuery选择器

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

  • jQuery选择器

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

  • jQuery相关知识

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

网友评论

      本文标题:jquery 的选择器

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