-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
121 lines (99 loc) · 3.17 KB
/
Copy pathindex.html
File metadata and controls
121 lines (99 loc) · 3.17 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!DOCTYPE html>
<html>
<head>
<!-- 이것은 주석입니다. -->
<link rel="stylesheet" href="./css/index.css" />
</head>
<body>
<h1 id="h1-title">웹 프로그래밍 강의 5주차</h1>
<button id="btnChangeTitle">제목 바꾸기</button>
<button id="btnTest">테스트</button>
<a href="profile.html"><h2>박종진</h2></a>
<h3>웹 개발(기술)의 이해</h3>
<h4 class="common-fontstyle">최초의 웹사이트</h4>
<p>1989년 팀버너스가 웹을 만듦.</p>
<img src="./image/Sir_Tim_Berners-Lee.jpeg" />
<p>최초의 웹사이트는 CERN 아직 존재함.</p>
<h4>주요개념</h4>
<ul>
<li>인터넷</li>
<li>
컴포넌트파일
<ul>
<li class="white-font">HTML</li>
<li class="red-font">CSS</li>
<li>JavaScript</li>
</ul>
</li>
</ul>
<h4>실습</h4>
<ol>
<li class="red-font">비주얼 스튜디오 코드 설치</li>
<li>index.html 파일 생성</li>
<li>크롬에서 index.html 파일 보기</li>
</ol>
<div>
<a href="layout.html">Layout</a>
</div>
<script>
function add(input1, input2) {
const output = input1 + input2;
return output;
}
function addThree(input1) {
const output = input1 + 3;
return output;
}
function getMyName() {
return "박종진";
}
function changeTitle(title) {
document.querySelector("#h1-title").innerHTML = title;
}
let clickCount = 0;
let orginTitle = "웹 프로그래밍 강의 5주차";
function onChangeTitleClick() {
// 처음 클릭시 박종진으로 제목이 보이고
// 두번째 클릭시 원래의 제목으로 보이게
// 세번째 다시 박종진
let myName = getMyName();
if (clickCount === 1) {
clickCount--;
} else {
clickCount++;
}
// clickCount++;
console.log('clickCount', clickCount);
if (clickCount === 1) {
changeTitle(myName);
} else {
changeTitle(orginTitle);
}
}
function onTestClick() {
console.log('onTestClick', myName);
}
// window.alert("경고!!!!!");
document.querySelector("#btnChangeTitle").onclick = onChangeTitleClick;
document.querySelector("#btnTest").onclick = onTestClick;
// var sum = function (input1, input2) {
// const output = input1 + input2;
// return output;
// }
// const output = getMyName();
// document.querySelector("#h1-title").innerHTML = getMyName();
// console.log(output);
// document.getElementsByClassName("h1-title").innerHTML = getMyName();
// var p = document.querySelector("p");
// var pAll = document.querySelectorAll("p");
// console.log(p);
// console.log(pAll);
// pAll.item(0).innerHTML = "첫번째 P";
// pAll.item(1).innerHTML = "두번째 P";
// pAll.item(2).innerHTML = "세번째 P";
// pAll.forEach(function (p) {
// p.innerHTML = "웹 프로그래밍 강의 4주차";
// });
</script>
</body>
</html>