Skip to content

perscholas-blended/dom-exercises

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dom-exercises

Exercise #1 (1): Changing text

  • Extend this HTML page such that on moving the mouse over the yellow box the text changes to "Can I help you?". Then, when the mouse is moved outside the box the text changes back to "Hello world!".

Exercise #2 (2): Changing colors

  • This page contains a 200x200px div. Write JS code that sets the initial color of the div to blue, then changes the color when the div is clicked. On the first click, it changes from blue to red, on the next click from red to green, then from green to blue (and once it's blue, it starts all over again).
  • In this exercise, you are only allowed to make changes inside <script>...</script> and cannot change other parts of the HTML code.

Exercise #2b (3): Randomizing initial color

  • Extend the previous exercise such that the div's initial color is chosen randomly.
  • Can you extend the code to work with an array of arbitrary colors? Whenever the div is clicked, change the color to the next on in the array (and start over after the last color).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages