开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜