June 2009
Intermediate to advanced
240 pages
5h 19m
English
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 ...