Traversing the DOM Tree with jQuery

Although jQuery can be extremely simple to use once you get the hang of it, there are so many functions and methods that it can be overwhelming and confusing at times.

One issue I had over the last week or so was figuring out how to simply traverse the DOM tree. Using jQuery selectors, it’s a breeze to do so; but what do you do when you’re working on a specific jQuery object and you want to go up or down the DOM tree?

A Sound Business Decision?

A few years ago, a regionally local grocery store chain made an innovative decision to begin offering free daycare within the store. As far as I know, they were the first (and, the only) major grocery chain to attempt something of this nature. The chain is known as Giant Food or Martin’s, depending on where the stores are located, and they are operated out of Pennsylvania. The chain dots most of the central-eastern seaboard from Pennsylvania down to North Carolina.

As I said, they opened centers inside of many of their stores called “Tree Houses”, which were structured environments in which children from ages three to ten could be entertained while their parents did the grocery shopping. Each patron of Martin’s, upon registering with the Tree House, could leave their children with the helpful, capable staff within the Tree House for up to 90 minutes on each shopping trip.