Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
filter vs find
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Kynn Jones  
View profile  
(1 user)  More options Feb 4 2008, 7:04 pm
From: "Kynn Jones" <kyn...@gmail.com>
Date: Mon, 4 Feb 2008 19:04:14 -0500
Local: Mon, Feb 4 2008 7:04 pm
Subject: filter vs find

Could someone explain to me the difference between filter and find.  Their
descriptions sound very similar to me.  What are the criteria to choose one
over the other?

TIA!

kynn


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeffrey Kretz  
View profile  
(1 user)  More options Feb 4 2008, 8:12 pm
From: "Jeffrey Kretz" <jeffkr...@hotmail.com>
Date: Mon, 4 Feb 2008 17:12:42 -0800
Local: Mon, Feb 4 2008 8:12 pm
Subject: RE: [jQuery] filter vs find

Filter applies the current selection, while Find searches child elements.

$('td').filter(expr) will remove any TDs that don't match the filter
criteria.

$('td').find('span') will find spans inside tds.  This is functionally
similar to $('td span');

JK

  _____  

From: jquery-en@googlegroups.com [mailto:jquery-en@googlegroups.com] On
Behalf Of Kynn Jones
Sent: Monday, February 04, 2008 4:04 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] filter vs find

Could someone explain to me the difference between filter and find.  Their
descriptions sound very similar to me.  What are the criteria to choose one
over the other?

TIA!

kynn


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Karl Swedberg  
View profile  
(1 user)  More options Feb 4 2008, 8:21 pm
From: Karl Swedberg <k...@englishrules.com>
Date: Mon, 4 Feb 2008 20:21:20 -0500
Local: Mon, Feb 4 2008 8:21 pm
Subject: Re: [jQuery] filter vs find
filter will select a certain subset (zero or more) of the already  
selected elements.

find will select a set of (zero or more) elements that are descendants  
of the already selected elements.

Here is an example:

<div class="peanuts">
        <p class="elephants"></p>
</div>
<div class="elephants">
        <p></p>
</div>

$('div').filter('.elephants'); // <-- selects the second div, because  
it has class="elephants"

$('div').find('.elephants'); // <-- selects the first paragraph,  
because it has class="elephants"

* Note that these two examples are very simple and would probably be  
better written as ...

$('div.elephants');

  ... and ...

$('div .elephants');

You can find some more complex examples here:

http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-pa...

--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com

On Feb 4, 2008, at 7:04 PM, Kynn Jones wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google