开发者

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

开发者 https://www.devze.com 2023-02-19 23:18 出处:网络
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():

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

精彩评论

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