- HTML5: The Missing Manual, Appendix B
What to do
Getting the starter files
Open up Brackets and connect to the unZIPed directory, which should be called jslab_exp2. Look at the three files, paying particular attention to shakespear.js.
Checking it out
Try to figure out
what is happening.
You might want to take a look at
functions reference to figure out what
Now interact with the page to see what it does.
Adding a click event handler
Add a new function similar to
but use a different style and a different paragraph.
You probably don’t want to just change border colors, so that a look
at the HTML
DOM Style Object reference to see what else can be done. Maybe
you can make the font bigger?
Try to keep it simple and be very careful with capitalization.
To test out your handler function, modify the
so that your handler is called as soon as the page is loaded.
Installing the handler
Look at how the handler is installed in and add in the two lines that will invoke your handler. Take a look at the HTML DOM events reference to see the other events that can be handled. Maybe you should try a double click this time.
By the way, you can make it so that when your double click on one paragraph, another is changed.
Mouse enter and leave
Change your page so that the color of a quote changes as you move the
mouse over it.
or HTML (easier).
Before you leave
Save your files! Use a USB stick or Google drive.