Exercises
The challenge exercises may require the use of the official jQuery documentation at http://api.jquery.com/
.
- Alter the code that introduces the
back to top
links, so that the links only appear after the fourth paragraph. - When a
back to top
link is clicked on, add a new paragraph after the link containing the messageYou were here
. Ensure that the link still works. - When the author's name is clicked, turn it bold (by adding an element, rather than manipulating classes or CSS attributes).
Challenge
: On a subsequent click of the bolded author's name, remove the<b>
element that was added (thereby toggling between bold and normal text).Challenge
: Add a class ofinhabitants
to each of the chapter's paragraphs without calling.addClass()
. Make sure to preserve any existing classes.