jQuery | parent descendant Selector
jQuery parent descendant Selector selects every element which are descendant to a specific(parent) element.
Syntax:
$("parent descendant")
Example:
<!DOCTYPE html> <html> <head> <script src= </script> <script> $(document).ready(function() { $("div span").css("color", "lightgreen"); }); </script> </head> <body> <h4>This div element has descendant span:</h4> <div> <span>DESCENDENT ELEMENT</span> </div> </body> </html> |
chevron_right
filter_none
Output:

Recommended Posts:
- jQuery | :parent Selector
- jQuery | parent > child Selector
- SASS | Parent Selector
- JQuery | Get the n-th level parent of an element
- jQuery | parent() & parents() with Examples
- jQuery | :gt() Selector
- jQuery | :even Selector
- jQuery | :first Selector
- jQuery | :odd Selector
- jQuery | :has() Selector with example
- jQuery | :lt() Selector
- jQuery | :contains() Selector
- jQuery | :not() Selector
- jQuery | * Selector
- jQuery | :last Selector
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



