Selecting Elements
As you saw in the prior section, the DOM provides methods such as getElementById and querySelector for accessing element nodes. jQuery exposes similar methods but with a more straightforward and powerful syntax for doing DOM selection. It allows more finite selection based on element, ID, class, or CSS. It also allows you to filter your selection. Finally, it allows you to select a single node or multiple nodes using the same selection syntax.
The jQuery Object and $
Like the JavaScript document object for working with the DOM, jQuery provides the object jquery for calling the many methods of jQuery. This includes doing selection. jQuery also provides the shortcut $ as a replacement for jquery. This means that jquery.hide() ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access