
jQuery Traversing
So far, we've only seen jQuery selectors that enable us to select elements further down the DOM tree. However, there are times when you'll need to pick a parent or ancestor variable and that's where jQuery's DOM traversal methods come in handy. We can conveniently navigate up, down, and around the DOM tree using these traversal methods.
One of the most famous features of jQuery is DOM traversal. To get the most out of it, you'll need to know how the elements in a DOM tree are linked.
<body>
<div class="container">
<h1>Hello World</h1>
<p>This is a <em>simple paragraph</em>.</p>
<ul>
<li>Item One</li>
<li>Item Two</li>
</ul>
</div>
</body>