forked from itscodenation/int-u3l4-23-24-student-exercises
-
Notifications
You must be signed in to change notification settings - Fork 0
/
domManipulation.js
45 lines (25 loc) · 1.06 KB
/
domManipulation.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
41
42
43
44
45
// html button elements
let contentButton = document.querySelector('.content-button');
let image1Button = document.querySelector('.image-1-button');
let image2Button = document.querySelector('.image-2-button');
// html content elements
let myName = document.querySelector('.name');
let myHobby = document.querySelector('.hobby');
let myLocation = document.querySelector('.location');
let image = document.querySelector('.image');
// CODE ALONG
// 1. An event listener is provided for the `contentButton`
// 2. When clicked, it should change the content of:
// - The `name` header.
// -- RETURN TO LESSON --
// CODE SOLO
// - The `hobby` paragraph.
// - The `location` paragraph.
contentButton.addEventListener('click', function() {
});
// 3. Add an event listener to the `image1Button`
// 4. When clicked, it should change the source of `image` to another image URL.
// 5. Add an event listener to the `image2Button`
// 6. When clicked, it should change the source of `image` to another image URL.
// BONUS
// 7. Try using different event types for your buttons.