Fork this CodePen.
Without editing the HTML, make the site look like this:
- In your JS file, declare variables that store all of the HTML elements you'll need access to.
- Use JS to change the text and image to make the webpage match the new comp. Make sure you change the
alt
text on the image too!
- The kittens page should match the colors from the comp. Look at the CSS file and notice the
.kitten-heading
and.kitten-box
rule blocks. Do some googlin' and find a way to add those classes to the elements through JavaScript in order to apply that styling.
- Uncomment the button in the HTML file. (This is the only time you should be touching the HTML file!)
- Refactor your JS code so that the page starts out being about puppies and changes to kittens on button click.
- Add functionality that will allow the user to toggle between the puppies and kittens. Make sure the styling changes as well. There are a lot of ways to approach this! If you want to add a second button to your HTML, you can!
- Slow down and take it step by step.
- Remember that console.logs are your friend.
- Refer to the DOM Manipulation lesson and the Event Listeners lesson.