O'Reilly logo

JavaScript Absolute Beginner’s Guide by Kirupa Chinnathambi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

25. Traversing the DOM

In This Chapter

Learn how to navigate the DOM tree

Use the various APIs you have for moving and re-parenting elements

Find an element’s sibling, parent, children, and more

As you may have realized by now, your DOM looks like a giant tree—a giant tree with elements dangerously hanging on to branches and trying to avoid the pointy things that litter the place. To get a little more technical, elements in your DOM are arranged in a hierarchy that defines what you eventually see in the browser:

Image

This hierarchy is used to help organize your HTML elements. It is also used to help your CSS style rules make sense of what styles ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required