<body>
<h1> Welcome to my home page </h1>
<p> I'm Donald Duck </p>
<p class="intro"> I live in duckburg</p>
<p class="intro"> I love duck</p>
<p> My best friend is monkey</p>
</body>

test 1: If we're going to filter out all the p The inner class is intro The elements of , The code is :

$('p').filter('.intro').css('background','pink');

result :

test 2: If we're going to filter out all the p The class inside is not intro The elements of , The code is :

$('p').not('.intro').css('background','cyan');

result :

Definition and Usage :

filter() Method returns elements that meet certain conditions .

This method allows you to specify a condition . Elements that do not meet the criteria are removed from the selection , Elements that meet the criteria will be returned .

This method is usually used to narrow the scope of searching for elements in the selected element combination .

Tips :filter() Methods and not() The method is the opposite .

namely :filter() What's filtered out is selected ,not() What's filtered is not .

jquery Filtration filter,not More articles about

  1. Learn more jQuery Element filtering

    × Catalog [1] Index filtering [2] Content filtering In front of the word Filtration is jQuery An important part of the expansion .jQuery An important part of selectors is filtering selectors . Except for the filter selector , There are also special element filtering methods . This article will introduce in detail j ...

  2. Verse 165 ,jQuery, Filter selector

    jQuery, Filter selector Learning points : 1. Basic filter 2. Content filter 3. Visibility filter 4. Sub element filter 5. Other methods Filter selector is short for : filter . It's actually a selector , And this selector is similar to CSS3 (h ...

  3. jQuery Traverse - Filter first(),last() and eq() Use

    jQuery Traverse - The most basic filtering method is first(),last() and eq(), They allow you to select specific elements based on where they are in a set of elements . Other filtering methods ( Such as filter() and not()) Allows you to choose from a specific bar ...

  4. MixItUp: Stunning ! be based on CSS3 &amp; jQuery Filtering and sorting plug-in for

    MixItUp It's a lightweight , But powerful jQuery  plug-in unit , Provides beautiful animation filtering and sorting functions for classified and ordered content . Especially suitable for portfolio sites , Gallery , Image blogs and any sort of classified or ordered content . How it works ? Mi ...

  5. jQuery Simple filter selector

    <!DOCTYPE HTML> <html> <head> <title> Use jQuery Basic filter selector </title> <scr ...

  6. Jquery Medium filter() Detailed description and transition Usage of

    filter() Method reduces the set of matching elements to those that match the specified selector . Detailed instructions If you give a representation DOM Elements of the collection jQuery object ,.filter() Method constructs a new... With a subset of matching elements jQuery ...

  7. jQuery Simple filter selector

    <html xmlns="http://www.w3.org/1999/xhtml"> <head>     <!--jQuery Selector details According to the information obtained ...

  8. jQuery Basic filter selector

    jQuery Basic filter selector : <h1>this is h1</h1> <div id="p1"> <h2>this is h2< ...

  9. Jquery Which kinds of filter selectors are there ?

    Jquery Which kinds of filter selectors are there ? Reprint ▼ label : jquery Filter selector classification classification : JQuery What are all the filter selectors : One . Basic filter selector ( Focus on the following eight ) :first  Choose first ...

Random recommendation

  1. Redhat Linux install JDK 1.7

    This article mainly introduces in Redhat Linux(Red Hat Enterprise Linux Server release 5.7 (Tikanga)) Installation on system JDK 1.7, Other Linux Platform installation is also big ...

  2. Install and set JAVA home on MAC OS with commandline

    I need to be in MAC Do some tests on , Because the tester is not installed Java, You can only install it yourself , Because you can't access the test machine through the graphical interface , It can only be installed from the command line JAVA. 1. Download the jre/jdk inst ...

  3. ( turn )tar.xz How to unzip the file

    XZ Compression, the latest king of compression xz This compression may be very strange , But you know xz It's the vast majority Linux The default is a compression tool . Before xz It has been rarely used , So there's almost no mention of . I'm downloading phpmyadmin I see ...

  4. Different ways to invoke a shared object/share library(.so)

    stay Linux Call in .so There are several ways to file . 1. Link directly at compile time . 2.dlopen/???

  5. [ turn ] JavaScript And events

    When interacting with the browser, the browser will trigger various events . For example, when we open a web page , The browser loads the page , Will trigger a load event : When we click on one of the pages “ place ”, The browser will be there “ place ” Trigger a ...

  6. asp.net In the registry to detect whether to install Office( thunderbolt /QQ Installed or not )

    original text  asp.net In the registry to detect whether to install Office( thunderbolt /QQ Installed or not ) testing Office Whether to install and get the installation route And installation version   The code is as follows Copy code #region testing Office whether ...

  7. Git Create and modify the version Library of

    What is a version Library ? Version library is also called warehouse , English name repository, You can simply understand it as a directory , All files in this directory can be Git Manage , Modification of each document . Delete ,Git Can track , So that history can be traced at any time , or ...

  8. Linux Record -open-falcon Open source monitoring system deployment

    Reference resources https://book.open-falcon.org/zh_0_2/quick_install/prepare.html One . Install the back end 1. Environmental preparation yum -y install redisyum ...

  9. Fiddler Grab the bag 【1】_ Introduction and Interface Overview

    One .   Introduction and comparison of main bag grabbing tools 1.Wireshark : General bag grabbing tool , It's a huge amount of information , You need to filter to get useful information , Catch only HTTP It's a little bit of a fortune to ask for . 2.Firebug.HttpWatch etc. Web Commissioning worker ...

  10. 【ASP.NET】Layout The use of,

    1. MasterPage _Layout.cshtml Similar to tradition WebForm Medium .master file , Play the purpose of reusing the overall framework of the page 1. Motherboard page code preview 1 <!DOCTYPE html> 2 <ht ...