cycling jQuery_Succinctly | Page 50

Sample: sample38.html

Notice that I am using the ! operator to change a Boolean value of true to false. This is because I want to remove elements from the set that have

elements as their parent element. The function passed to the filter() method will only remove elements from the set if the function returns false. The main point is that if you are dealing with an isolated situation, creating a custom filter—e.g. :findImgWithNoP—for a single situation can be avoided by simply passing the filter method a function that can do custom filtering. This concept is quite powerful. Consider what is possible when we use a regular expressions test in conjunction with the filter() method. Sample: sample39.html

50