Home >>jQuery Tutorial >jQuery find() Method

jQuery find() Method

jQuery find() Method

jQuery find() method in jQuery is used to returns descendant elements of the selected element. It can be a child, grandchild, great-grandchild, and so on.


Parameter Values

Parameter Description
filter It is a required parameter and is used for a selector expression, element or jQuery object to filter the search for descendants
Here is an Example of jQuery find() Method:

.ancestors * { 
display: block;
border: 2px solid lightgrey;
color: lightgrey;
padding: 5px;
margin: 15px;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
$("ul").find("span").css({"color": "dodgerblue", "border": "2px solid #df65f7"});
<div class="ancestors">
<div style="width:500px;">div (grandparent)
<ul>ul (direct parent)  
<li>li (child)
<span>span (grandchild)</span>

div (grandparent)
    ul (direct parent)
  • li (child) span (grandchild)