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