Managing the wrapped element set

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

 

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
基于Django+python编写开发的毕业生就业管理系统支持学生教师角色+db数据库(毕业设计新项目).zip 【备注】 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用!有问题请及时沟通交流。 2、适用人群:计算机相关专业(如计科、信息安全、数据科学与大数据技术、人工智能、通信、物联网、自动化、电子信息等)在校学生、专业老师或者企业员工下载使用。 3、用途:项目具有较高的学习借鉴价值,不仅适用于小白学习入门进阶。也可作为毕设项目、课程设计、大作业、初期项目立项演示等。 4、如果基础还行,或热爱钻研,亦可在此项目代码基础上进行修改添加,实现其他不同功能。 欢迎下载!欢迎交流学习!不清楚的可以私信问我! 基于Django+python编写开发的毕业生就业管理系统支持学生教师角色+db数据库(毕业设计新项目).zip基于Django+python编写开发的毕业生就业管理系统支持学生教师角色+db数据库(毕业设计新项目).zip基于Django+python编写开发的毕业生就业管理系统支持学生教师角色+db数据库(毕业设计新项目).zip基于Django+python编写开发的毕业生就业管理系统支持学生教师角色+db数据库(毕业设计新项目).zip基于Django+python编写开发的毕业生就业管理系统支持学生教师角色+db数据库(毕业设计新项目).zip基于Django+python编写开发的毕业生就业管理系统支持学生教师角色+db数据库(毕业设计新项目).zip基于Django+python编写开发的毕业生就业管理系统支持学生教师角色+db数据库(毕业设计新项目).zip基于Django+python编写开发的毕业生就业管理系统支持学生教师角色+db数据库(毕业设计新项目).zip基于Django+python编写开发的毕业生就业管理系统支持学生教师角色+db数据库(毕业设计新项目).zip
毕设新项目基于python3.7+django+sqlite开发的学生就业管理系统源码+使用说明(含vue前端源码).zip 【备注】 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用!有问题请及时沟通交流。 2、适用人群:计算机相关专业(如计科、信息安全、数据科学与大数据技术、人工智能、通信、物联网、自动化、电子信息等)在校学生、专业老师或者企业员工下载使用。 3、用途:项目具有较高的学习借鉴价值,不仅适用于小白学习入门进阶。也可作为毕设项目、课程设计、大作业、初期项目立项演示等。 4、如果基础还行,或热爱钻研,亦可在此项目代码基础上进行修改添加,实现其他不同功能。 欢迎下载!欢迎交流学习!不清楚的可以私信问我! 学生就业管理系统(前端) ## 项目开发环境 - IDE: vscode - node版本: v12.14.1 - npm版本: 6.13.4 - vue版本: @vue/cli 4.1.2 - 操作系统: UOS 20 ## 1.进入项目目录安装依赖 ``` npm install ``` ## 2.命令行执行进入UI界面进行项目管理 ``` vue ui ``` ## 3.编译发布包(请注意编译后存储路径) #### PS:需要将编译后的包复制到后端项目的根目录下并命名为'static' 学生就业管理系统(后端) ## 1.项目开发环境 - IDE: vscode - Django版本: 3.0.3 - Python版本: python3.7.3 - 数据库 : sqlite3(测试专用) - 操作系统 : UOS 20 ## 2.csdn下载本项目并生成/安装依赖 ``` pip freeze > requirements.txt pip install -r requirements.txt ``` ## 3.项目MySQL数据库链接错误 [点击查看解决方法](https://www.cnblogs.com/izbw/p/11279237.html)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值