-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathid.html
35 lines (31 loc) · 816 Bytes
/
id.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Id</title>
<style>
#box-1 {
width: 100px;
height: 100px;
background-color: pink;
}
#box-2{
width: 100px;
height: 100px;
background-color: blue;
}
</style>
</head>
<body>
<div id="box-1"></div>
<div id="box-2"></div>
<script>
const box1 = document.getElementById("box-1");
console.log("box1: ", box1);
const box2 = document.querySelector("#box-2");
console.log("box2: ", box2);
</script>
</body>
</html>