Exercise Wednesday

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

Update your pet website or boring lecture website by completing one of the following exercises. If you did not complete either of those websites, pick another website to update.

Toggling Between a Light and Dark Theme

  • Most people like dark text on a light background, but some people prefer light text on a dark background. Update your chosen website 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.

Highlighting a Paragraph on Click

  • Update your chosen website so that when somebody clicks on a paragraph, it highlights it and adds a box around the edges.

Lesson 40 of 65
Last updated May 23, 2022