jQuery in Action
Managing the wrapped element set
33
In order to visually help you in this endeavor, another lab page has been set up
and included in the downloadable example code for this chapter: the Wrapped
Set Lab, which you will find in chapter2/lab.wrapped.set.html. This page, which
looks a lot like the Selectors Lab we examined earlier in this chapter, is shown in
figure 2.6.
Set Lab, which you will find in chapter2/lab.wrapped.set.html. This page, which
looks a lot like the Selectors Lab we examined earlier in this chapter, is shown in
figure 2.6.
This new lab page not only looks like the Selectors Lab, it also operates in a
similar fashion. Except in this Lab, rather than typing a selector, we can type in
a complete jQuery wrapped set operation. The operation is applied to the
a complete jQuery wrapped set operation. The operation is applied to the
DOM
Sample, and, as with the Selectors Lab, the results are displayed.
In this sense, the Wrapped Set Lab is a more general case of the Selectors
Lab. Whereas the latter only allowed us to enter a single selector, the Wrapped
Set Lab allows us to enter any expression that results in a jQuery wrapped set.
Because of the way jQuery chaining works, this expression can also include com-
mands, making this a powerful Lab for examining the operations of jQuery. Be
Set Lab allows us to enter any expression that results in a jQuery wrapped set.
Because of the way jQuery chaining works, this expression can also include com-
mands, making this a powerful Lab for examining the operations of jQuery. Be
Figure 2.6 The Wrapped Set Lab helps us see how wrapped sets can be created and managed.