forked from itscodenation/flw1-u1l7-23-24-student-exercises
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shapes.js
40 lines (25 loc) · 1.12 KB
/
shapes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// html elements
let circle = document.querySelector(".circle");
let square = document.querySelector(".square");
let rectangle = document.querySelector(".rectangle");
circle.addEventListener("click", function() {
// 1. Update the circle using the style property.
// - Set the background color to purple.
// - Set the width to 150px.
// - Set the height to 150px.
});
square.addEventListener("click", function() {
// 2. Update the square using the style property.
// - Set the background color to yellow.
// - Set the width to 150px.
// - Set the height to 150px.
});
rectangle.addEventListener("click", function() {
// 3. Update the rectangle using the style property.
// - Set the background color to orange.
// - Set the width to 250px.
// - Set the height to 150px.
});
// Extension: Check out the available CSS properties here: https://www.w3schools.com/cssref/index.php
// - Set a new CSS property and value for each shape using the same style property syntax.
// - See if you can get the rectangle to disappear when clicked (hint: check out the display CSS property)