Chapter 12. Advanced DOM Manipulation

Throughout this book, we have used jQuery's powerful DOM manipulation methods to alter the content of the document. We have now seen several ways in which we can insert new content, move existing content around, or remove content altogether. We also know how to alter the attributes and properties of elements to suit our needs.

In Chapter 5, Manipulating the DOM, we were introduced to these important techniques. In this more advanced chapter, we will cover:

  • Sorting page elements using .append()
  • Attaching custom data to elements
  • Reading HTML5 data attributes
  • Creating elements from JSON data
  • Extending the DOM manipulation system using CSS hooks

Sorting table rows

The majority of the topics we're investigating in this ...

Get Learning jQuery - Fourth Edition 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.