Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Whack-a-mole!
- Oh no, my yard is infested with moles! Help me whack them! Follow the instructions below to use jQuery to remove each mole!
- Let's start with the first mole at the top. It has the ID `mole1`. How do we fix the code provided on lines 1-3 so that the mole disappears when we click on it? Hint: You'll need to change the selectors from "FIXME" to the name of mole you want to hide.
- Did you get rid of the first mole?! **YES? GREAT!**
- Now let's get rid of the others. Look at the HTML fo find the IDs of the second and third moles. Can you fill in the missing jQuery on lines 5-11 to get rid of the other moles? Use the first click handler to help you!
- Let's write the code that will let us play this game again. Fill in the selectors in the last click handler (lines 13-15) so when you click on the button all the moles show.
- ### BONUS
- Now if you've ever dealt with moles you know that you can never get rid of them!
- Instead of hiding the third mole, make the other moles appear when a user clicks the third mole.
- *HINT:* What's the opposite of .hide()?
Add Comment
Please, Sign In to add comment