In the context of this exercise, what does the
.children() method return?
.children() method returns a jQuery object containing all the direct children of the specified element.
You can access individual child elements similarly to accessing elements in an array, by index in the returned object. For example, say that you had the following HTML,
<div class="parent"> <p>Child 1</p> <p>Child 2</p> </div>
We can see the individual child elements by doing something like the following,
var children = $(".parent").children(); console.log(children); // <p>Child 1</p> console.log(children); // <p>Child 2</p>