Possible Duplicate:
What is the new proper way to use a child selector with a context node in jQuery?
From the jQuery docs:
Note: The $("> elem", context) selector will be deprecated in a future release. Its usage is thus discouraged in lieu of using alternative selectors.
http://api.jquery.com/child-selector/
What would be an alternative selector
for this?
The :nth-child(n) selector matches every element that is the nth child of its parent. n can be a number, a keyword (odd or even), or a formula (like an + b). Tip: Look at the :nth-of-type() selector to select the element that is the nth child, of the same type (tag name), of its parent.
The CSS child combinator ( > ) can be used to select all elements that are the immediate children of a specified element. A combinator combines and explains the relationship between two or more selectors.
With <li> tag.
A child selector matches when an element is the child of some element. A child selector is made up of two or more selectors separated by ">". Example(s): The following rule sets the style of all P elements that are children of BODY: body > P { line-height: 1.3 }
$(context).children('elem')
also $("> elem", context)
is deprecated, but $(context+" >elem")
and $("parent>child")
are not
$('parent').children('childrenelements')
Is my guess :)
But as the other poster said, its only searching directly for childs in a context.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With