[jQuery] Re: filter vs find

2008-02-04 Thread Karl Swedberg
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').filter('.elephants'); // <-- selects the seco

[jQuery] Re: filter vs find

2008-02-04 Thread Jeffrey Kretz
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@goog