Reputation: 6295
how to determine the child of a UL using jquery?
im trying to change the class of the LI items in a UL based on their child type in a clickevent of an element?
Upvotes: 1
Views: 75
Reputation: 187020
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.
Reputation: 8474
see following example
http://api.jquery.com/children/
Upvotes: 2