forked from HackYourFuture/Assignments
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathindex.js
More file actions
21 lines (17 loc) · 896 Bytes
/
index.js
File metadata and controls
21 lines (17 loc) · 896 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*------------------------------------------------------------------------------
Full description at: https://github.com/HackYourFuture/Assignments/tree/main/2-Browsers/Week1#exercise-2-about-me
1. Using JavaScript, replace each of the spans (`nickname`, fav-food`,
`hometown`) with your own information.
2. In JavaScript, iterate through each `<li>` and change the class to
`list-item`.
3. Look in the css file!
------------------------------------------------------------------------------*/
const ul = document.querySelector('ul').children;
const nickname = document.getElementById('nickname');
const favFood = document.getElementById('fav-food');
const hometown = document.getElementById('hometown');
nickname.textContent = 'Alooy';
favFood.textContent = 'Burgers';
hometown.textContent = 'Dongen';
const arr = Array.from(ul);
arr.forEach((ele) => (ele.className = 'list-item'));