开发者

JQuery: How can I select all descendant nodes of an element that have a certain css class on them?

Given a DOM element e, I woul开发者_如何学JAVAd like to select all descendants that have class='foo'. How can I do this in jquery?


Use .find():

$(e).find('.foo')

(The documentation is your friend :))


You can use some thing like $(this).childrens().hasClass('foo'), I will try to give the exact answer, if I know the exact query.. please try to be more precise in your question.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜