jQuery in Action
72
CHAPTER 3
Bringing pages to life with jQuery
Before we move on to other commands that work in a similar fashion, let's look at
an example to make sure that this important concept is clear. We've set up a lab
page with some elements to serve as the source of an
an example to make sure that this important concept is clear. We've set up a lab
page with some elements to serve as the source of an
appendTo()
operation and
some to serve as targets. Upon initial display, this Move and Copy Laboratory
Page looks as shown in figure 3.5.
Page looks as shown in figure 3.5.
The
HTML
markup for the test candidates in the fieldsets is as follows:
<fieldset id="source">
<legend>Source elements</legend>
<img id="flower" src="flower.png"/>
<img id="car" src="car.png"/>
</fieldset>
Figure 3.5 The Move and Copy Laboratory Page is set up to illustrate the operation of the
appendTo
and
prependTo
commands.