Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 would like to select all descendants that have class='foo'. How can I do this in jquery?

like image 637
morpheus Avatar asked Jan 24 '26 08:01

morpheus


1 Answers

Use .find():

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

(The documentation is your friend :))

like image 101
Felix Kling Avatar answered Jan 25 '26 23:01

Felix Kling



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!