Skip to content

Instantly share code, notes, and snippets.

@percworld
Forked from kaylagordon/DOM_Practice.md
Created December 11, 2020 17:54
Show Gist options
  • Save percworld/2e9300e4f6504bbdae644bc8c8aaeed9 to your computer and use it in GitHub Desktop.
Save percworld/2e9300e4f6504bbdae644bc8c8aaeed9 to your computer and use it in GitHub Desktop.

DOM Manipulation Practice

πŸ’» Set Up

Fork this CodePen.

πŸ“ Goal

Without editing the HTML or CSS code, make the site look like this when the user clicks the button: comp

🎨 Resources

πŸ‘Ÿ Steps

  1. In your JS file, declare variables that store all of the HTML elements you'll need access to.
  2. Use JS to change the text and image to make the webpage match the new comp. Do not worry about colors just yet!
  3. Uncomment the button in the HTML file. (This is the only time you should be touching the HTML file!)
  4. Refactor your JS code so that the page starts out being about puppies and changes to kittens on button click.
  5. Now focus on the styling. The kittens page should match the colors from the comp.

🌢 Spicy Challenge

Add functionality that will allow the user to toggle between the puppies and kittens. There are a lot of ways to approach this! If you want to add a second button to your HTML, you can!

🀯 Stuck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment