Loopandfunction.html
4.48 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<!doctype html>
<html>
<head>
<title>KHU KHU Chat</title>
<meta charset="utf-8">
<link rel="stylesheet" href="style.css">
<script>
function LinksSetColor(color){
var alist=document.querySelectorAll('a');
var i =0;
while(i<alist.length)
{
alist[i].style.color=color;
i+=1;
}
}
var Body={
setColor:function(color){
}
}
function bodySetColor(color){
document.querySelector('body').style.color= color;
}
function bodySetBackGruondColor(color){
document.querySelector('body').style.backgroundColor= color;
}
function nightDayHandler(self){
if(self.value==='night')
{
bodySetBackGruondColor('black')
bodySetColor('white');
self.value= 'day';
setColor('powderblue');
}else{
bodySetBackGruondColor('white')
bodySetColor('black');
self.value= 'night';
setColor('blue');
}
}
</script>
</head>
<body>
<h1><a href="main.html" color:black>KHU Chatting service</a></h1>
<img src="image/signin.jpg" class="image">
<!--refactoring and conditional statement -->
<!-- about this grammer
<input type="button" value="night" onclick="
if(this.value==='night')
{
document.querySelector('body').style.backgroundColor= 'black';
document.querySelector('body').style.color= 'white';
this.value= 'day';
}else{
document.querySelector('body').style.backgroundColor= 'white';
document.querySelector('body').style.color= 'black';
this.value= 'night';
}
">
-->
<!-- about array
<script>
var cowokers=["minsing","minsoft"];
document.write(cowokers[0]);
document.write(cowokers[1]);
cowokers.push("ssssss")
document.write(cowokers);
</script>
-->
<!-- about Loop
<ul>
<script>
var i=0;
while(i<3)
{
document.write("<li>var</li>")
i+=1;
}
</script>
</ul>
-->
<!--Loop & Array
<script>
var cowokers=["minsung","leezche","minsoft","sdy"];
</script>
<script>
var i=0;
while( i< cowokers.length ){
document.write('<li><a href="http://a.com/'+cowokers[i]+'">'+cowokers[i]+'</a></li>');
i+=1;
}
</script>
-->
<!-- Loop apply
var alist=document.querySelectorAll('a');
var i =0;
while(i<alist.length){
console.log(alist[i]);
i+=1;
}
-->
<!-- button 1 usage array and Loop for chage style
self를 통한 input의 객체 지정해주기
지정해주기전에는 전역객체를 가르키게 된다.
-->
<input id="night_day" type="button" value="night" onclick="
nightDayHandler(this);
">
<!-- button2 making and using function -->
<input id="night_day" type="button" value="night" onclick="
nightDayHandler(this);
">
<div id="grid">
<ol>
<li><a href="whatiskhuchat.html" class="saw">What is KHU chat? </a></li>
<li><a href="loginmain.html" class="saw">로그인</a></li>
<li><a href="signinmain.html" class="saw">회원가입</a></li>
<li><a href="question.html" class="saw">문의사항</a></li>
<li><a href="afterlogin.html" class="saw">로그인이후</a></li>
</ol>
<div id="article">
<h2>회원가입</h2>
<div id="inputset">
<form class="signinform" action="loginmain.html">
<label for="email">Email:</label><br>
<input type="text" name="email"><br>
<label for="password">password:</label><br>
<input type="password" name="password"><br>
<label for="name">이름:</label><br>
<input type="text" name="name"><br>
<label for="age">나이:</label><br>
<input type="text" name="age"><br><br>
<label for="sex">성별:</label><br>
<input type="radio" value="man" name="sex">남자<br>
<input type="radio" value="woman" name="sex">여자<br><br>
<label for="work">직업:</label><br>
<input type="radio" value="nowork" name="work">무직<br>
<input type="radio" value="Hstudent" name="work">중/고생<br>
<input type="radio" value="Ustudent" name="work">대학생<br>
<input type="radio" value="worker" name="work">직장인<br><br>
<label for="interesting">관심사(중복선택가능):</label><br>
<input type="checkbox" value="movie" name="interesting">영화<br>
<input type="checkbox" value="song" name="interesting">노래<br>
<input type="checkbox" value="study" name="interesting">공부<br>
<input type="checkbox" value="coding" name="interesting">코딩<br><br>
<input type="submit" value="회원가입신청">
</form>
</div>
</div>
</div>
</body>
</html>