summary | time | deliverables |
---|---|---|
Use Javascript keyboard events so that when a key is pressed a circle shows up randomly on the screen. |
1 hour |
1 HTML file, 1 CSS file, 1 JS file |
- Fork this repository.
- Write an event listener in Javascript that listens for
keydown
- When the event is triggered create a brand new
<div>
- Generate a random
left
andtop
coordinate for the<div>
usingMath.random()
- Place the
<div>
on the page in the random position. - Run it through Markbot and make sure it passes all the checks.
Create the interaction shown in the linked video.
Drop this folder into your Markbot application. Make sure to fix all the errors. And submit online.
These challenges are here if you’d like to try a little more work—they are for extra experience and learning. They are completely optional and not graded. Show them to me if you’d like—I’d love to see them.
- When a new circle is added make its
background-color
randomized.
Watch this video to see how it interacts.