<script> tags isn’t
For example, to add a quick effect when the mouse pointer passes
over an object, you can use code such as that in the
<img /> tag in Example 20-6, which displays an apple by default,
but replaces it with an orange when the mouse passes over (and restores
the apple when the mouse leaves).
In the preceding example you see the
to operate on the calling object, namely the
<img /> tag. You can see the result in
Figure 20-2, where the
mouse pointer is yet to pass over the apple.
this keyword represents the calling object.
When used in class methods, the
this keyword represents an object to which
the method applies.
The preceding code is the equivalent of providing an ID to the
<img /> tag and then attaching
the actions to the tag’s mouse events, like in Example 20-7.