-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
19 lines (15 loc) · 769 Bytes
/
Copy pathindex.js
File metadata and controls
19 lines (15 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
document.query;
//changing the last item in the list to be my name
var h3 = document.firstElementChild.lastElementChild.querySelector("ul").lastElementChild;
//alert("Variable name is: " + h3);
h3.innerHTML = "David Hu";
//changing the link color to be red
var h2 = document.firstElementChild.lastElementChild.querySelector("ul").firstElementChild.querySelector("a");
//alert(h2);
h2.style.color = "red";
//change the background color of the button to be yellow
var buttonBg = document.firstElementChild.lastElementChild.querySelector("button");
buttonBg.style.backgroundColor = "yellow";
//change font size of h1 by adding the "huge" class we made to the classlist
var h1 = document.firstElementChild.lastElementChild.querySelector("h1");
h1.classList.add("huge");