/ttmar

[js][events][clickevents][dom]

Primary LanguageHTML

Take the Money and Run!

Do Not Touch Anything in the body tag. You are only allowed to write code in javascript.

Write some JS to do the following

  • When the first link on the page is clicked, the background color should change to something that is not white, blue, or black.

  • When the second through fifth links are clicked, the relevant part of the song should be displayed.

Remember to use the DOMContentLoaded event: document.addEventListener('DOMContentLoaded', doSomething); or you might have a bad time.

BONUS!

  • When the last link is clicked, one line of the chorus should be displayed. Each subsequent click should display an additional line of the chorus until all 6 lines are displayed.

BONUS 2

  • For each click, the background color changes to a random color.

BONUS 3

  • Keep count of the total number of clicks, and alert the user when they get to five clicks.

BONUS 4

  • For each click the background color changes to a random color, then changes back after 5 seconds.

BONUS 5

  • Let the user enter the name of the element to reveal through an HTML input. Use a button to submit the input. (Hint: you won't need an event parameter in your callback for this.)

BONUS 5.5

  • Let the user know when they've entered the name of an element that doesn't exist.