Skip to content
Related Articles

Related Articles

jQuery | parent descendant Selector
  • Last Updated : 12 Mar, 2019
GeeksforGeeks - Summer Carnival Banner

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>

Output:

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :