Home > Web Front-end > JS Tutorial > body text

Example of usage of not() method in jQuery_jquery

WBOY
Release: 2016-05-16 16:21:48
Original
1575 people have browsed it

The example in this article describes the usage of the not() method in jQuery. Share it with everyone for your reference. The specific analysis is as follows:

This method removes elements that match the specified expression.

Grammar structure 1:

Copy code The code is as follows:
$(selector).not(expr)

Parameter list:

参数 描述
expr 字符串值,定义筛选表达式。

Example code:

Copy code The code is as follows:






not() function-Script Home






  • HTML Zone

  • Javascript Zone

  • Div Css Zone

  • Jquery Zone





The above code can return the number of li elements in the jquery object after deleting the li with the class name js.

Grammar structure 2:

Parameter list:

参数 描述
element 要被删除的DOM元素。

Example code:

Copy code The code is as follows:






not() function script home






  • HTML Zone

  • Javascript Zone

  • Div Css Zone

  • Jquery Zone





The above code can return the number of li elements in the jquery object after deleting the li with the id value of js.

Grammar structure three:

Copy code The code is as follows:
$(selector).not(function)

Parameter list:

参数 描述
function(index) 用来遍历元素的集合函数,并返回要被删除的一个元素
此函数接受一个参数index,这是元素在jQuery集合的索引。
在函数中, this指的是当前的DOM元素。

实例代码:

复制代码 代码如下:






not()函数脚本之家





 

       
  • HTML专区

  •    
  • Javascript专区

  •    
  • Div Css专区

  •    
  • Jquery专区

  •  




希望本文所述对大家的jQuery程序设计有所帮助。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!