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.
精彩评论