Select Matching Children .children()

.children([selector])

e.g. $("div").children("span")

.children(selector) selects direct children of each element in the matched set, children can be optionally filtered by selector.

Example 1: $("div").children() will first find all <div> then select children of each <div>.
<div>
  <span>A-1</span>
  <span>A-2</span>
</div>
<div>
  <p>B-1</p>
  <span>B-2</span>
</div>
Example 2: $("div").children("span") will first find all <div> then select children of type <span>.
<div>
  <span>A-1</span>
  <span>A-2</span>
</div>
<div>
  <p>B-1</p>
  <span>B-2</span>
</div>
jQuery traversing tree .children()