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
23 lines (21 loc) · 934 Bytes
/
index.js
File metadata and controls
23 lines (21 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*------------------------------------------------------------------------------
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!
------------------------------------------------------------------------------*/
function aboutMe() {
const nickname = document.querySelector ('#nickname');
nickname.textContent = 'Rim';
const favFood = document.querySelector ('#fav-food');
favFood.textContent = 'Sushi';
const hometown = document.querySelector ('#hometown');
hometown.textContent = 'Tokyo';
const listItems = document.querySelectorAll ('li');
listItems.forEach(item => {
item.classList.add('list-item');
});
}
aboutMe();