Guest User

Untitled

a guest
Feb 22nd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. ### Whack-a-mole!
  2. Oh no, my yard is infested with moles! Help me whack them! Follow the instructions below to use jQuery to remove each mole!
  3.  
  4. 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.
  5.  
  6. Did you get rid of the first mole?! **YES? GREAT!**
  7.  
  8. 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!
  9.  
  10. 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.
  11.  
  12.  
  13. ### BONUS
  14. Now if you've ever dealt with moles you know that you can never get rid of them!
  15.  
  16. Instead of hiding the third mole, make the other moles appear when a user clicks the third mole.
  17.  
  18. *HINT:* What's the opposite of .hide()?
Add Comment
Please, Sign In to add comment