Remember, any jQuery wrapped set can be used as an array of element references.
1.Determining the size of the wrapped set
Command syntax:size()
Returns the count of elements in the wrapped set
Parameters
none
Returns
The element count
2.Obtaining elements from the wrapped set
Command syntax:get(index)
Obtains one or all of the matched elements in the wrapped set. If no parameter is specified, all elements in the wrapped set are returned in a JavaScript array.
If an index parameter is provided, the indexed element is returned.
Parameters
index (Number) The index of the single element to return. If omitted, the entire set is returned in an array.
Returns
A DOM element or an array of DOM elements.
3.Slicing and dicing the wrapped element set
Command syntax:add(expression)
Adds elements, specified by the expression parameter, to the wrapped set. The expression can be a selector, an HTML fragment, a DOM element, or an array of DOM elements.
Parameters
expression (String|Element|Array) Specifies what is to be added to the matched set.
This parameter can be a jQuery selector , in which case any matched
elements are added to the set. If an HTML fragment, the appropriate
elements are created and added to the set. If a DOM element or an array
of DOM elements, they are added to the set.
Returns
The wrapped set.
eg: $('p').add('<div>Hi there!</div>') //This fragment creates a wrapped set of all <p> elements in the document, and then creates a new <div>, and adds it to the wrapped set
Command syntax:not(expression)
Removes elements from the matched set according to the value of the expression parameter. If the parameter is a jQuery filter selector, any matching elements are removed.
If an element reference is passed, that element is removed from the set.
Parameters
expression (String|Element|Array) A jQuery filter expression, element reference, or array of element references defining what is to be removed from the wrapped set.
Returns
The wrapped set.
eg: $('img[title]').not('[title*=puppy]') //selects all the images with title attribute, then remove the element from the wrapped set which element's title contains "puppy"
Command syntax:filter(expression)
Filters out elements from the wrapped set using a passed selector expression, or a filtering function.
Parameters
expression (String|Function) Specifies a jQuery selector used to remove all elements that do not match from the wrapped set, or a function that makes the
filtering decision. This function is invoked for each element in the set, with the current element set as the function context for that invocation.
Any element that returns an invocation of false is removed from the set.
Returns
The wrapped set.
eg: $('td').filter(function(){return this.innerHTML.match(/^\d+$/)}) //This jQuery expression creates a wrapped set of all <td> elements and then invokes the function passed to the filter() method for each, with the current matched elements as the this value for the invocation. The function uses a regular expression to determine if the element content matches the described pattern
(a sequence of one or more digits), returning false if not. Every element whose filter function invocation returns false is removed from the wrapped set.
Command syntax:slice(begin,end)
Creates and returns a new wrapped set containing a contiguous portion of the matched set.
Parameters
begin (Number) The zero-based position of the first element to be included in the returned slice.
end (Number) The optional zero-based index of the first element not to be included in the returned slice, or one position beyond the last element to be included.
If omitted, the slice extends to the end of the set.
Returns
The newly created wrapped set.
eg: $('*').slice(0,4); //selects all elements on the page and then creates a set containing the first four elements.
4.Getting wrapped sets using relationships
Methods to obtain new wrapped set based on relationships
![](/upload/picture/pic/76957/4e85fdfb-af0f-3ea5-ad86-4d6ba7b9bf7a.png)
All of the methods above, with the exception of contents(), accept a parameter containing a string that can be used to filter the results.
5.Even more ways to use a wrapped set
Command syntax:find(selector)
Returns a new wrapped set containing all elements of the original set that match the passed
selector expression.
Parameters
selector (String) A jQuery selector that elements must match to become part of the returned set.
Returns
The newly created wrapped set.
Command syntax:contains(text)
Returns a new wrapped set composed of elements that contain the text string passed as the text parameter
Parameters
text (String) The text that an element must contain in order to be added to the returned set
Returns
The newly created wrapped set
Command syntax:is(selector)
Determines if any element in the wrapped set matches the passed selector expression
Parameters
selector (String) The selector expression to test against the elements of the wrapped set
Returns
true if at least one element matches the passed selector; false if not
6.Managing jQuery chains
Command syntax:end()
Used within a chain of jQuery command to back up the wrapped set to a previously returned set
Parameters
none
Returns
The previous wrapped set
eg: $('img').clone().appendTo('#somewhere').end().addClass('beenCloned'); // clone the original set to the element which id is "somewhere", then add css class to the left of original set
Command syntax:andSelf()
Merges the two previous wrapped sets in a command chain
Parameters
none
Returns
The merged wrapped set
分享到:
相关推荐
一、ERA5数据下载,deepseek提问全图
UE5 MQTT通信插件
【vue】基于 Vue3 + Element Plus 实现,支持 RBAC 动态权限、数据权限、SaaS 多租户、Flowable 工作流、三方登录、支付、短信、商城、CRM 等功能_pgj
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。
该项目为基于C#语言的智能诊断交付系统插件设计源码,总计包含122个文件,涉及多种类型,包括70个元数据文件、26个C#源代码文件、6个预制体文件、5个材质文件、3个着色器文件、3个Unity脚本文件、2个汇编定义文件、1个Cginc文件、1个Markdown文件、1个光照文件。该系统专注于智能诊断交付,旨在提升诊断交付的效率和准确性。
内容概要:本文探讨了一个经典的数组操作问题——在一个已经排序的数组中去除多余的重复元素,确保每个元素最多出现两次。该问题要求算法在原地执行(不引入新的数据结构),并且仅消耗O(1)的额外存储空间。文中详细展示了问题的要求与挑战,给出具体的示例帮助理解,并明确指出了解题思路和预期效果。 适用人群:面向有一定编程经验的学习者或者初涉Python开发的语言爱好者,尤其是对算法有兴趣的人群。 使用场景及目标:适用于那些希望提升自己数据处理技巧,特别是有关列表、数组的操作技能的人。该方法可以在内存有限的情况下进行高效的去重处理,比如嵌入式系统或者大规模数据分析环境。 其他说明:该算法主要运用双指针(快慢指针)的方法,在遍历数组的同时实现对原始数据的部分覆盖来达到减少重复项目的目的,同时也提醒使用者注意'引用'特性可能引起的潜在误解。
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。
深海沉积物岩心GeoB17603-2的文档记录 内容 该文献由Lucchi RG、Sabbatini A、Nicolaisen LS等人于2014年发布,主要描述了深海沉积物岩心GeoB17603-2的相关信息。具体内容涉及岩心的采集情况及其详细特征等。读者可通过访问"此链接" ()获取更多关于该数据集的信息。遗憾的是,目前尚未提供该数据集的具体大小。
本项目为Node.js学习资源集,包含41个文件,涵盖26个JavaScript文件、4个HTML文件、3个JSON文件、3个文本文件、2个Markdown文件、1个Git忽略文件、1个PNG图像文件、1个TypeScript文件。内容丰富,涉及Node.js学习的各个方面,旨在帮助开发者掌握相关技能。
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。
本项目是一个基于Vue框架和JavaScript的前端样式设计源码,专注于实现图片对比效果,通过input range控件实现风格切换。该项目包含87个文件,其中SVG文件48个,JavaScript文件16个,Vue文件8个,JPG图片文件5个,JSON文件3个,开发配置文件1个,生产配置文件1个,Git忽略文件1个,Markdown文件1个,HTML文件1个。项目适用于需要展示和比较不同图片风格的场景。
MAX30102心率血样传感器原理图
资源名称:Python—Excel选表头列key-value-转json文件 类型:windows—exe可执行工具 环境:Windows10或以上系统 功能: 1. 点击按钮【选择文件】:选择一个Exel文件(默认第一行为表头) 2. 点击选择key列(可多选-多个中间用“=”隔开) 3. 点击选择value列(可多选-多个中间用“=”隔开) 4. 点击按钮【选择文件】:保存路径 5. 点击按钮【转换并保存】:保存路径 优点: 1、非常快的速度! 2、已打包—双击即用!无需安装! 3、自带GUI界面方便使用!
该项目是一个个人作品集设计源码,采用HTML、JavaScript和CSS技术构建,包含50个文件,其中包括12个HTML文件、10个JavaScript文件、9个JPG图片文件、6个PNG图片文件、4个CSS样式表文件、3个SVG矢量图形文件、以及各种字体文件,如EOT、TTF、WOFF和WOFF2等。该作品集旨在展示个人设计作品,适合个人网站或在线展示使用。
该项目是一款基于C语言核心开发,并融合HTML、CSS、Python等多语言技术的智能仓储安防控制系统源码。项目包含360个文件,其中225个为头文件(.h),32个为C语言源文件(.c),27个为压缩文件(.gz),8个为共享库文件(.so),7个为静态库文件(.a),6个为配置文件(.1, .pc, .cmake)和3个XML文件(.xml)。该系统旨在提供智能化的仓储安防解决方案。
鱼码grant.dll是一个简单易用的标准DLL,让软件开发者快速为自己软件加上注册码,支持在线和离线授权,实现商用授权许可。鱼码可以让开发者快速为自己软件加上软件升级功能 软件托管,0成本搭建平台,在线销售自己软件,管理授权码。 dll使用说明可进入演示地址进行查看。 安装: 1、下载dll注册成开发者 2、调用dll里check_grant函数 3、会员中心管理自己授权码发放或过期、删除等操作 软件有vb、vb.net、vc、vc.net、易语言和Delphi示例,压缩包中的为vb.net的,如果需要其他版本的demo请到官网进行下载。
乡村小道图像分割系统:智能化检测
内容概要:本文介绍了新碧彩SaaS平台项目的特点及其建设优势。新碧彩SaaS平台采用了云托管方式部署,利用微服务架构进行业务拓展,统一接口管理和多租户模式以降低运营成本、提高灵活性。通过集群部署及专业的运维团队,保障租户使用的稳定性、安全性、高效率。平台实现了采购业务全流程的规范化管理及优化。同时支持快速扩展各类业务应用,包括财务管理、办公自动化、人力资源等多个方面。 适合人群:对于物业公司或其他相关行业的技术人员、管理者及关注企业数字化转型的从业者。 使用场景及目标:①解决现有采购管理系统难以适应快速增长的企业规模和发展需求的问题;②通过引入新技术提升管理水平和服务质量;③实现业务处理流程化、数据化的目标,并能轻松对接第三方服务商的数据接口服务。 其他说明:本文详细阐述了如何借助现代化信息技术手段,助力企业转型升级为智能型企业,特别是在当前中国物业管理市场背景下尤为重要。此外还提到平台未来可能会继续围绕用户体验改进功能特性,如提供更多增值服务等。
该项目为基于Java开发的在线书城设计源码,包含55个文件,涵盖41个Java源文件、10个XML配置文件、2个Git忽略文件、1个YAML文件和1个TXT文件。