-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdom.js
More file actions
24 lines (16 loc) · 780 Bytes
/
dom.js
File metadata and controls
24 lines (16 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function change1(){
document.getElementById("text").innerHTML = "Hello World!";
document.getElementById("text").style.color = "red";
}
function change2(){
document.getElementById("yt").href ="https://www.google.com";
document.getElementById("yt").innerHTML = "Google";
}
function change3(){
document.getElementsByName('print')[0].style.backgroundColor = "red";
document.getElementsByName('print')[1].style.backgroundColor = "red";
document.getElementsByTagName('p')[0].style.color = "yellow";
document.getElementsByTagName('p')[1].style.color = "yellow";
document.getElementsByTagName('p')[2].style.color = "yellow";
document.getElementsByClassName('header')[0].style.backgroundColor = "blue";
}