-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
The .filter(function)
method only gets DOM elements passed in, while .each(function)
gets all DOM nodes, including text nodes. This used to work in RC-5, but doesn't in RC-9. And as far as I could tell, this isn't expected behaviour, because I wasn't able to find info indicating that it is in the jQuery docs.
Consider the following html snippet:
<body>
<div style="color: black;">Hello</div>
world
<small>!</small>
</body>
If I were to select the body and .filter
its contents, I won't get the world
text node in my filter loop. Whereas I will get the world
text node in my loop if I use .each
on the contents of the body.
I've created a repo demonstrating my findings.
Edit: just checked, it also used to work with RC-6. That means it stopped working with the RC-9 release.
Vincent-Pang
Metadata
Metadata
Assignees
Labels
No labels