Goal: Continue to familiarize yourself with jQuery, and explore these important methods by completing the exercises listed below.

Warm Up

  • What can be accomplished by dynamically adding and removing classes with jQuery? Why would we want to do this?
  • When should we use .css()? Why do we use this particular method?


Adding and Remove Classes with jQuery

  • Most people like dark text on a light background, but some people prefer light text on a dark background. Update your dog blog or cat homepage to include a button that lets your users switch to light on dark.
  • Now, update this page so that users can switch back to the original color scheme.
  • Update your boring lecture page so that when somebody clicks on a paragraph, it highlights it and adds a box around the edges.

Lesson 34 of 59
Last updated October 12, 2021