Skip to content
Related Articles

Related Articles

jQuery | parent descendant Selector

View Discussion
Improve Article
Save Article
  • Last Updated : 21 Nov, 2021
View Discussion
Improve Article
Save Article

jQuery parent descendant Selector selects every element which are descendant to a specific(parent) element. 
Syntax: 

$("parent descendant")

Example:  

html




<!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>DESCENDANT ELEMENT</span>
    </div>
 
</body>
 
</html>

Output: 

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!