how to determine the child of a <ul> using jquery?
how to determine the child of a UL using jquery?
im trying to ch开发者_如何学Goange the class of the LI items in a UL based on their child type in a clickevent of an element?
see following example
http://api.jquery.com/children/
If you want to get the child elements then you can use
$("yourulid > li").addClass("something");
and if you want to get the descendant elements then
$("yourulid li").addClass("something");
See it working here.
精彩评论