O'Reilly logo

Microsoft Visual Studio 2015 Unleashed, Third Edition by Mike Snell, Lars Powers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required