CHAPTER 5

image

DOM Traversing

This chapter covers jQuery methods for DOM traversing. Chapter 3 explained how to use jQuery selectors to get (or select) HTML elements based on their ID, tag name, class name, types, attributes, attribute values, and other criteria. Chapters 3 and 4 covered how a set of selected elements can be further fine-tuned using selector extensions, filtering methods, and expansion methods. DOM traversing methods can be used to select ancestors, descendants, and siblings of selected elements. Once you have the desired set of elements, you can access and manipulate their attributes (including values), properties, and styles.

Get jQuery 2 Recipes: A Problem-Solution Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.