-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjavascript_test.html
More file actions
82 lines (54 loc) · 1.52 KB
/
javascript_test.html
File metadata and controls
82 lines (54 loc) · 1.52 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>javascript_test</title>
<style>
.box{
width:200px;
height :200px;
background: red;
}
</style>
</head>
<body>
<div class="box"></div>
<script>
const userName = "착한호랑이"; //string
const age = 43; // number
const married = false; //boolean
let girlFriend; //undefined
const money = null; //null
console.log(typeof userName);
console.log(typeof age);
console.log(typeof married);
console.log(typeof girlFriend);
console.log(typeof money);
console.log(2-3);
console.log(userName === '착한호랑이');
console.log(age < 30);
if(userName === '나쁜호랑이'){
console.log('정답!');
}else{
console.log('오답!');
}
if(userName === '어벙한호랑이'){
console.log('안녕 난 어벙한 호랑이야');
}else if(userName === '멍청한호랑이'){
console.log('안녕 난 멍청한 호랑이야');
}else if(userName === '나쁜호랑이') {
console.log('안녕 난 나쁜 호랑이야');
}else{
console.log('안녕 난 착한 호랑이야');
}
// 정의 조건 갱신
for(let i = 0; i<100; i++){
console.log(i + '번이야');
}
// document.getElementsByClassName('box');
// const box = document.querySelectorAll('.box');
const box = document.querySelector('.box');
console.log(box);
</script>
</body>
</html>