tags:

views:

30

answers:

2

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?

+2  A: 

see following example

http://api.jquery.com/children/

Saar
+1  A: 

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.

rahul