Skip to Content
jQuery: Visual QuickStart Guide
book

jQuery: Visual QuickStart Guide

by Steven Holzner
June 2009
Intermediate to advanced content levelIntermediate to advanced
240 pages
5h 19m
English
Peachpit Press
Content preview from jQuery: Visual QuickStart Guide

2. Selecting Elements the jQuery Way

One of jQuery’s specialties is letting you select page elements so you can work on them.

You will often need to select page elements in online work. The selection capabilities of browsers are minimal and mostly involve the JavaScript getElementByID function, which requires you to add an ID value to any element you want to select (making selection of multiple items difficult, or at least time consuming).

CSS offers a much stronger set of tools for selecting page elements to set styles, and jQuery adopts many of the CSS selectors. Using the jQuery selectors lets you select page elements so you can work on them in JavaScript, not just with CSS styles.

You saw some basic selectors in the previous chapter, but ...

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.
Start your free trial

You might also like

Beginning jQuery

Beginning jQuery

Jack Franklin

Publisher Resources

ISBN: 9780321679673Purchase book