3. Working with Elements the jQuery Way

In this chapter, we’ll take a guided tour of jQuery’s features for working with the elements and attributes in a page—all designed to let you access and manipulate page elements easily.

For instance, jQuery lets you access elements to change their HTML and text, set and read element attributes, and add new elements to a page and remove others.

All these manipulations are possible with jQuery functions (they’re actually jQuery methods, but the distinction between functions and methods is sometimes blurred in jQuery, so we’ll refer to them as functions).

Function Examples

This chapter explores a range of jQuery functions that will help you work with elements.

For example, you can use the each( ) function ...

Get jQuery: Visual QuickStart Guide 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.